Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed common/src/web/html5/blue.jpg
Binary file not shown.
84 changes: 0 additions & 84 deletions common/src/web/html5/database.js

This file was deleted.

18 changes: 0 additions & 18 deletions common/src/web/html5/geolocation.js

This file was deleted.

Binary file removed common/src/web/html5/green.jpg
Binary file not shown.
Binary file removed common/src/web/html5/red.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion common/src/web/html5/status.html

This file was deleted.

11 changes: 0 additions & 11 deletions common/src/web/html5/test.appcache

This file was deleted.

Binary file removed common/src/web/html5/yellow.jpg
Binary file not shown.
27 changes: 3 additions & 24 deletions common/src/web/html5Page.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
<html manifest="html5/test.appcache">
<html>
<head>
<title>HTML5</title>
</head>
<body>

<h3>Geolocation Test</h3>
<div id="status">Location unknown</div>
<script language="javascript" type="text/javascript" src="html5/geolocation.js"></script>

<h3>Web SQL Database Test</h3>
<div id="logs"></div>
<script language="javascript" type="text/javascript" src="html5/database.js"></script>

<h3>Application Cache Test</h3>
<div id="images">
<p>Current network status: <span id="state"></span></p>
<script>
var state = document.getElementById('state')
setInterval(function () {
state.className = navigator.onLine ? 'online' : 'offline';
state.innerHTML = navigator.onLine ? 'online' : 'offline';
}, 250);
</script>
<img id="red" src="html5/red.jpg">
<img id="blue" src="html5/blue.jpg">
<img id="green" src="html5/green.jpg">
<img id="yellow" src="html5/yellow.jpg">
</div>
</body>
</html>

</body>
</html>
Comment on lines 9 to 11
74 changes: 0 additions & 74 deletions java/src/org/openqa/selenium/remote/DriverCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,80 +107,6 @@ public interface DriverCommand {
String PRINT_PAGE = "printPage";
String IMPLICITLY_WAIT = "implicitlyWait";
String SET_SCRIPT_TIMEOUT = "setScriptTimeout";
String GET_LOCATION = "getLocation";
String SET_LOCATION = "setLocation";

/**
* @deprecated localStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("return window.localStorage.getItem('key')") instead.
*/
@Deprecated String GET_LOCAL_STORAGE_ITEM = "getLocalStorageItem";

/**
* @deprecated localStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("return Object.keys(window.localStorage)") instead.
*/
@Deprecated String GET_LOCAL_STORAGE_KEYS = "getLocalStorageKeys";

/**
* @deprecated localStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("window.localStorage.setItem('key', 'value')") instead.
*/
@Deprecated String SET_LOCAL_STORAGE_ITEM = "setLocalStorageItem";

/**
* @deprecated localStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("window.localStorage.removeItem('key')") instead.
*/
@Deprecated String REMOVE_LOCAL_STORAGE_ITEM = "removeLocalStorageItem";

/**
* @deprecated localStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("window.localStorage.clear()") instead.
*/
@Deprecated String CLEAR_LOCAL_STORAGE = "clearLocalStorage";

/**
* @deprecated localStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("return window.localStorage.length") instead.
*/
@Deprecated String GET_LOCAL_STORAGE_SIZE = "getLocalStorageSize";

/**
* @deprecated sessionStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("return window.sessionStorage.getItem('key')") instead.
*/
@Deprecated String GET_SESSION_STORAGE_ITEM = "getSessionStorageItem";

/**
* @deprecated sessionStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("return Object.keys(window.sessionStorage)") instead.
*/
@Deprecated String GET_SESSION_STORAGE_KEYS = "getSessionStorageKey";

/**
* @deprecated sessionStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("window.sessionStorage.setItem('key', 'value')") instead.
*/
@Deprecated String SET_SESSION_STORAGE_ITEM = "setSessionStorageItem";

/**
* @deprecated sessionStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("window.sessionStorage.removeItem('key')") instead.
*/
@Deprecated String REMOVE_SESSION_STORAGE_ITEM = "removeSessionStorageItem";

/**
* @deprecated sessionStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("window.sessionStorage.clear()") instead.
*/
@Deprecated String CLEAR_SESSION_STORAGE = "clearSessionStorage";

/**
* @deprecated sessionStorage is not part of W3C WebDriver spec. Use ((JavascriptExecutor)
* driver).executeScript("return window.sessionStorage.length") instead.
*/
@Deprecated String GET_SESSION_STORAGE_SIZE = "getSessionStorageSize";

// W3C Actions APIs
String ACTIONS = "actions";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_VALUE_OF_CSS_PROPERTY;
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_DIALOG_TYPE;
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_TITLE;
import static org.openqa.selenium.remote.DriverCommand.GET_LOCATION;
import static org.openqa.selenium.remote.DriverCommand.GET_TIMEOUTS;
import static org.openqa.selenium.remote.DriverCommand.GET_TITLE;
import static org.openqa.selenium.remote.DriverCommand.GO_BACK;
Expand All @@ -73,7 +72,6 @@
import static org.openqa.selenium.remote.DriverCommand.SELECT_ACCOUNT;
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ELEMENT;
import static org.openqa.selenium.remote.DriverCommand.SET_DELAY_ENABLED;
import static org.openqa.selenium.remote.DriverCommand.SET_LOCATION;
import static org.openqa.selenium.remote.DriverCommand.SET_SCRIPT_TIMEOUT;
import static org.openqa.selenium.remote.DriverCommand.SET_TIMEOUT;
import static org.openqa.selenium.remote.DriverCommand.SET_USER_VERIFIED;
Expand Down Expand Up @@ -175,11 +173,6 @@ public AbstractHttpCommandCodec() {
defineCommand(SET_SCRIPT_TIMEOUT, post(timeouts + "/async_script"));
defineCommand(IMPLICITLY_WAIT, post(timeouts + "/implicit_wait"));

defineCommand(
GET_LOCATION, get(sessionId + "/location")); // Not w3c; used in RemoteLocationContext
defineCommand(
SET_LOCATION, post(sessionId + "/location")); // Not w3c; used in RemoteLocationContext

// Virtual Authenticator API
String webauthn = sessionId + "/webauthn/authenticator";
String webauthnId = webauthn + "/:authenticatorId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.openqa.selenium.remote.DriverCommand.ACCEPT_ALERT;
import static org.openqa.selenium.remote.DriverCommand.ACTIONS;
import static org.openqa.selenium.remote.DriverCommand.CLEAR_ACTIONS_STATE;
import static org.openqa.selenium.remote.DriverCommand.CLEAR_LOCAL_STORAGE;
import static org.openqa.selenium.remote.DriverCommand.CLEAR_SESSION_STORAGE;
import static org.openqa.selenium.remote.DriverCommand.DISMISS_ALERT;
import static org.openqa.selenium.remote.DriverCommand.EXECUTE_ASYNC_SCRIPT;
import static org.openqa.selenium.remote.DriverCommand.EXECUTE_SCRIPT;
Expand All @@ -48,27 +46,17 @@
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_RECT;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_SHADOW_ROOT;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_SIZE;
import static org.openqa.selenium.remote.DriverCommand.GET_LOCAL_STORAGE_ITEM;
import static org.openqa.selenium.remote.DriverCommand.GET_LOCAL_STORAGE_KEYS;
import static org.openqa.selenium.remote.DriverCommand.GET_LOCAL_STORAGE_SIZE;
import static org.openqa.selenium.remote.DriverCommand.GET_LOG;
import static org.openqa.selenium.remote.DriverCommand.GET_PAGE_SOURCE;
import static org.openqa.selenium.remote.DriverCommand.GET_SESSION_STORAGE_ITEM;
import static org.openqa.selenium.remote.DriverCommand.GET_SESSION_STORAGE_KEYS;
import static org.openqa.selenium.remote.DriverCommand.GET_SESSION_STORAGE_SIZE;
import static org.openqa.selenium.remote.DriverCommand.GET_WINDOW_HANDLES;
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_DISPLAYED;
import static org.openqa.selenium.remote.DriverCommand.MAXIMIZE_CURRENT_WINDOW;
import static org.openqa.selenium.remote.DriverCommand.MINIMIZE_CURRENT_WINDOW;
import static org.openqa.selenium.remote.DriverCommand.PRINT_PAGE;
import static org.openqa.selenium.remote.DriverCommand.REMOVE_LOCAL_STORAGE_ITEM;
import static org.openqa.selenium.remote.DriverCommand.REMOVE_SESSION_STORAGE_ITEM;
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ELEMENT;
import static org.openqa.selenium.remote.DriverCommand.SET_ALERT_VALUE;
import static org.openqa.selenium.remote.DriverCommand.SET_CURRENT_WINDOW_POSITION;
import static org.openqa.selenium.remote.DriverCommand.SET_CURRENT_WINDOW_SIZE;
import static org.openqa.selenium.remote.DriverCommand.SET_LOCAL_STORAGE_ITEM;
import static org.openqa.selenium.remote.DriverCommand.SET_SESSION_STORAGE_ITEM;
import static org.openqa.selenium.remote.DriverCommand.SET_TIMEOUT;
import static org.openqa.selenium.remote.DriverCommand.SUBMIT_ELEMENT;
import static org.openqa.selenium.remote.DriverCommand.UPLOAD_FILE;
Expand Down Expand Up @@ -117,18 +105,6 @@ public W3CHttpCommandCodec() {
defineCommand(EXECUTE_ASYNC_SCRIPT, post(sessionId + "/execute/async"));

alias(GET_PAGE_SOURCE, EXECUTE_SCRIPT);
alias(CLEAR_LOCAL_STORAGE, EXECUTE_SCRIPT);
alias(GET_LOCAL_STORAGE_KEYS, EXECUTE_SCRIPT);
alias(SET_LOCAL_STORAGE_ITEM, EXECUTE_SCRIPT);
alias(REMOVE_LOCAL_STORAGE_ITEM, EXECUTE_SCRIPT);
alias(GET_LOCAL_STORAGE_ITEM, EXECUTE_SCRIPT);
alias(GET_LOCAL_STORAGE_SIZE, EXECUTE_SCRIPT);
alias(CLEAR_SESSION_STORAGE, EXECUTE_SCRIPT);
alias(GET_SESSION_STORAGE_KEYS, EXECUTE_SCRIPT);
alias(SET_SESSION_STORAGE_ITEM, EXECUTE_SCRIPT);
alias(REMOVE_SESSION_STORAGE_ITEM, EXECUTE_SCRIPT);
alias(GET_SESSION_STORAGE_ITEM, EXECUTE_SCRIPT);
alias(GET_SESSION_STORAGE_SIZE, EXECUTE_SCRIPT);

String window = sessionId + "/window";
defineCommand(MAXIMIZE_CURRENT_WINDOW, post(window + "/maximize"));
Expand Down Expand Up @@ -220,54 +196,6 @@ public W3CHttpCommandCodec() {
+ "if (!source) { source = new XMLSerializer().serializeToString(document); }\n"
+ "return source;");

case CLEAR_LOCAL_STORAGE:
return toScript("localStorage.clear()");

case GET_LOCAL_STORAGE_KEYS:
return toScript("return Object.keys(localStorage)");

case SET_LOCAL_STORAGE_ITEM:
return toScript(
"localStorage.setItem(arguments[0], arguments[1])",
parameters.get("key"),
parameters.get("value"));

case REMOVE_LOCAL_STORAGE_ITEM:
return toScript(
"var item = localStorage.getItem(arguments[0]); localStorage.removeItem(arguments[0]);"
+ " return item",
parameters.get("key"));

case GET_LOCAL_STORAGE_ITEM:
return toScript("return localStorage.getItem(arguments[0])", parameters.get("key"));

case GET_LOCAL_STORAGE_SIZE:
return toScript("return localStorage.length");

case CLEAR_SESSION_STORAGE:
return toScript("sessionStorage.clear()");

case GET_SESSION_STORAGE_KEYS:
return toScript("return Object.keys(sessionStorage)");

case SET_SESSION_STORAGE_ITEM:
return toScript(
"sessionStorage.setItem(arguments[0], arguments[1])",
parameters.get("key"),
parameters.get("value"));

case REMOVE_SESSION_STORAGE_ITEM:
return toScript(
"var item = sessionStorage.getItem(arguments[0]);"
+ " sessionStorage.removeItem(arguments[0]); return item",
parameters.get("key"));

case GET_SESSION_STORAGE_ITEM:
return toScript("return sessionStorage.getItem(arguments[0])", parameters.get("key"));

case GET_SESSION_STORAGE_SIZE:
return toScript("return sessionStorage.length");

case IS_ELEMENT_DISPLAYED:
return executeAtom("isDisplayed.js", asElement(parameters.get("id")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,6 @@ void dealsWithUtf16() {
assertThat(pageText).contains("\u05E9\u05DC\u05D5\u05DD");
}

@Test
void manifestHasCorrectMimeType() throws IOException {
String url = server.whereIs("html5/test.appcache");
HttpClient.Factory factory = HttpClient.Factory.createDefault();
HttpClient client = factory.createClient(new URL(url));
HttpResponse response = client.execute(new HttpRequest(HttpMethod.GET, url));

System.out.printf("Content for %s was %s%n", url, string(response));

assertThat(
stream(response.getHeaders("Content-Type").spliterator(), false)
.anyMatch(header -> header.contains(APPCACHE_MIME_TYPE)))
.isTrue();
}

@Test
void uploadsFile() throws Throwable {
String FILE_CONTENTS = "Uploaded file";
Expand Down
Loading
Loading