From f59e02313d8c717489dbc88bef84b20ea821c33b Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Sat, 14 Mar 2026 13:11:35 +0000 Subject: [PATCH] [Javascript] Delete dead atoms that won't work in browsers This deletes code that have been removed from the web platform. These dont work anywhere so removing them as part of the plan to move the atoms to typescript --- common/src/web/html5/blue.jpg | Bin 92 -> 0 bytes common/src/web/html5/database.js | 84 -------- common/src/web/html5/geolocation.js | 18 -- common/src/web/html5/green.jpg | Bin 92 -> 0 bytes common/src/web/html5/red.jpg | Bin 92 -> 0 bytes common/src/web/html5/status.html | 1 - common/src/web/html5/test.appcache | 11 - common/src/web/html5/yellow.jpg | Bin 92 -> 0 bytes common/src/web/html5Page.html | 27 +-- .../openqa/selenium/remote/DriverCommand.java | 74 ------- .../codec/AbstractHttpCommandCodec.java | 7 - .../remote/codec/w3c/W3CHttpCommandCodec.java | 72 ------- .../webserver/AppServerTestBase.java | 15 -- javascript/atoms/BUILD.bazel | 19 -- javascript/atoms/fragments/BUILD.bazel | 24 --- javascript/atoms/html5/appcache.js | 47 ----- javascript/atoms/html5/database.js | 141 ------------- javascript/atoms/html5/html5_browser.js | 153 -------------- javascript/atoms/html5/location.js | 72 ------- javascript/atoms/html5/storage.js | 197 ------------------ javascript/chrome-driver/BUILD.bazel | 16 -- .../selenium-webdriver/lib/test/fileserver.js | 1 - javascript/webdriver/atoms/BUILD.bazel | 189 +---------------- javascript/webdriver/atoms/inject/BUILD.bazel | 150 ------------- javascript/webdriver/atoms/inject/appcache.js | 36 ---- .../webdriver/atoms/inject/local_storage.js | 101 --------- .../webdriver/atoms/inject/session_storage.js | 101 --------- .../webdriver/atoms/inject/sql_database.js | 57 ----- .../webdriver/atoms/storage/appcache.js | 36 ---- .../webdriver/atoms/storage/local_storage.js | 96 --------- .../atoms/storage/session_storage.js | 96 --------- javascript/webdriver/command.js | 23 -- 32 files changed, 4 insertions(+), 1860 deletions(-) delete mode 100644 common/src/web/html5/blue.jpg delete mode 100644 common/src/web/html5/database.js delete mode 100644 common/src/web/html5/geolocation.js delete mode 100644 common/src/web/html5/green.jpg delete mode 100644 common/src/web/html5/red.jpg delete mode 100644 common/src/web/html5/status.html delete mode 100644 common/src/web/html5/test.appcache delete mode 100644 common/src/web/html5/yellow.jpg delete mode 100644 javascript/atoms/html5/appcache.js delete mode 100644 javascript/atoms/html5/database.js delete mode 100644 javascript/atoms/html5/html5_browser.js delete mode 100644 javascript/atoms/html5/location.js delete mode 100644 javascript/atoms/html5/storage.js delete mode 100644 javascript/webdriver/atoms/inject/appcache.js delete mode 100644 javascript/webdriver/atoms/inject/local_storage.js delete mode 100644 javascript/webdriver/atoms/inject/session_storage.js delete mode 100644 javascript/webdriver/atoms/inject/sql_database.js delete mode 100644 javascript/webdriver/atoms/storage/appcache.js delete mode 100644 javascript/webdriver/atoms/storage/local_storage.js delete mode 100644 javascript/webdriver/atoms/storage/session_storage.js diff --git a/common/src/web/html5/blue.jpg b/common/src/web/html5/blue.jpg deleted file mode 100644 index 8ea27c42faa7b5e56c43d3db317d5e4ecf1cb613..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmZ?wbhEHbG-5DfXkcJaWSGJLB!991Nd^WT5CM{5U@~s$UwQg1|Kd4YZgp?Ix92y1 s+ar%@&pMaAI<@T`_wi3Y*T3~X|8?&BKYkvr_9KfvcKB$ivocr%04xP0fB*mh diff --git a/common/src/web/html5/database.js b/common/src/web/html5/database.js deleted file mode 100644 index c6333be8cd006..0000000000000 --- a/common/src/web/html5/database.js +++ /dev/null @@ -1,84 +0,0 @@ -var database={}; -database.db={}; - -database.onError = function(tx, e) { - var log = document.createElement('div'); - log.setAttribute('name','error'); - log.setAttribute('style','background-color:red'); - log.innerText = e.message; - document.getElementById('logs').appendChild(log); -} - -database.onSuccess = function(tx, r) { - if (r.rows.length) { - var ol; - for (var i = 0; i < r.rows.length; i++) { - ol = document.createElement('ol'); - ol.innerHTML = r.rows.item(i).ID + ": " + r.rows.item(i).docname + " (" + r.rows.item(i).created + ")"; - document.getElementById('logs').appendChild(ol); - } - - } -} - -database.open=function(){ - database.db=openDatabase('HTML5', '1.0', 'Offline document storage', 100*1024); -} - -database.create=function(){ - database.db.transaction(function(tx) { - tx.executeSql("CREATE TABLE IF NOT EXISTS docs(ID INTEGER PRIMARY KEY ASC, docname TEXT, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP)", - [], - database.onSuccess, - database.onError); - });} - -database.add = function(message) { - database.db.transaction(function(tx){ - tx.executeSql("INSERT INTO docs(docname) VALUES (?)", - [message], database.onSuccess, database.onError); - }); -} - -database.selectAll = function() { - database.db.transaction(function(tx) { - tx.executeSql("SELECT * FROM docs", [], database.onSuccess, - database.onError); - }); -} - -database.onDeleteAllSuccess = function(tx, r) { - var doc = document.documentElement; - var db_completed = document.createElement("div"); - db_completed.setAttribute("id", "db_completed"); - db_completed.innerText = "db operation completed"; - doc.appendChild(db_completed); -} - -database.deleteAll = function() { - database.db.transaction(function(tx) { - tx.executeSql("delete from docs", [], database.onDeleteAllSuccess, - database.onError); - }); -} - -var log = document.createElement('div'); -log.setAttribute('name','notice'); -log.setAttribute('style','background-color:yellow'); -log.innerText = typeof window.openDatabase == "function" ? "Web Database is supported." : "Web Database is not supported."; -document.getElementById('logs').appendChild(log); - -try { - database.open(); - database.create(); - database.add('Doc 1'); - database.add('Doc 2'); - database.selectAll(); - database.deleteAll(); -} catch(error) { - var log = document.createElement('div'); - log.setAttribute('name','critical'); - log.setAttribute('style','background-color:pink'); - log.innerText = error; - document.getElementById('logs').appendChild(log); -} diff --git a/common/src/web/html5/geolocation.js b/common/src/web/html5/geolocation.js deleted file mode 100644 index f07af148ed016..0000000000000 --- a/common/src/web/html5/geolocation.js +++ /dev/null @@ -1,18 +0,0 @@ -function success(position) { - var message = document.getElementById("status"); - message.innerHTML =""; - message.innerHTML += "

Longitude: " + position.coords.longitude + "

"; - message.innerHTML += "

Latitude: " + position.coords.latitude + "

"; - message.innerHTML += "

Altitude: " + position.coords.altitude + "

"; -} - -function error(msg) { - var message = document.getElementById("status"); - message.innerHTML = "Failed to get geolocation."; -} - -if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(success, error); -} else { - error('Geolocation is not supported.'); -} \ No newline at end of file diff --git a/common/src/web/html5/green.jpg b/common/src/web/html5/green.jpg deleted file mode 100644 index 6a0d3bea4793a5fe3a3a36e29ba174540540513d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmZ?wbhEHbG-5DfXkcJqT;s&Rz@Ye(1xPY5=zs{23bCU^SwR4 t`P&|OOncV3?A57l@3@bD^11%4_xZ1L-~aLRaJ3&<^s&Q7OP!U$8UQ`xB)R|q diff --git a/common/src/web/html5/red.jpg b/common/src/web/html5/red.jpg deleted file mode 100644 index f296e271956d5d4e0939b9706e86b2c2bc0d65b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmZ?wbhEHbG-5DfXkcLY$H2kBz@Ye(1xPY5=zs{23bCU^SwR4 t`P&|OOncV3?A57l@3@bD^11%4_xZ1L-~aLRaJ3&<^s&Q7OP!U$8URKdB+&o> diff --git a/common/src/web/html5/status.html b/common/src/web/html5/status.html deleted file mode 100644 index 394116a522dd4..0000000000000 --- a/common/src/web/html5/status.html +++ /dev/null @@ -1 +0,0 @@ -Online diff --git a/common/src/web/html5/test.appcache b/common/src/web/html5/test.appcache deleted file mode 100644 index 3bc4e00257664..0000000000000 --- a/common/src/web/html5/test.appcache +++ /dev/null @@ -1,11 +0,0 @@ -CACHE MANIFEST - -CACHE: -# Additional items to cache. -yellow.jpg -red.jpg -blue.jpg -green.jpg - -FALLBACK: -status.html offline.html diff --git a/common/src/web/html5/yellow.jpg b/common/src/web/html5/yellow.jpg deleted file mode 100644 index 7c609b371291aeb672feb6bc24497d5f64d20288..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmZ?wbhEHbG-5DfXkcLYcZ>lD6o0aSC0GH&T#dHOB?;yGJxb#K16=Qn@b rBadm%I+wjVwe21E@lQV2zx6) + HTML5 -

Geolocation Test

-
Location unknown
- - -

Web SQL Database Test

-
- - -

Application Cache Test

-
-

Current network status:

- - - - - -
+ + diff --git a/java/src/org/openqa/selenium/remote/DriverCommand.java b/java/src/org/openqa/selenium/remote/DriverCommand.java index 7102dfae5df17..aa4fa19bffac5 100644 --- a/java/src/org/openqa/selenium/remote/DriverCommand.java +++ b/java/src/org/openqa/selenium/remote/DriverCommand.java @@ -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"; diff --git a/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java b/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java index 81d1abac2c401..63f7d99cd65b2 100644 --- a/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java +++ b/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java @@ -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; @@ -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; @@ -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"; diff --git a/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java b/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java index b28399c11d1c4..fbdcd29f60c4f 100644 --- a/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java +++ b/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java @@ -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; @@ -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; @@ -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")); @@ -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"))); diff --git a/java/test/org/openqa/selenium/environment/webserver/AppServerTestBase.java b/java/test/org/openqa/selenium/environment/webserver/AppServerTestBase.java index 758194dace09c..bb80e4ba27b35 100644 --- a/java/test/org/openqa/selenium/environment/webserver/AppServerTestBase.java +++ b/java/test/org/openqa/selenium/environment/webserver/AppServerTestBase.java @@ -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"; diff --git a/javascript/atoms/BUILD.bazel b/javascript/atoms/BUILD.bazel index b6b787107fb39..8194295d544ac 100644 --- a/javascript/atoms/BUILD.bazel +++ b/javascript/atoms/BUILD.bazel @@ -217,24 +217,6 @@ closure_js_library( ], ) -closure_js_library( - name = "html5", - srcs = glob(["html5/*.js"]), - suppress = [ - "JSC_IMPLICITLY_NULLABLE_JSDOC", - "JSC_UNKNOWN_EXPR_TYPE", - "JSC_USE_OF_GOOG_PROVIDE", - ], - deps = [ - ":bot", - ":errors", - ":json", - ":useragent", - "//third_party/closure/goog/useragent", - "//third_party/closure/goog/useragent:product", - ], -) - closure_js_library( name = "inject", srcs = ["inject.js"], @@ -390,7 +372,6 @@ closure_js_deps( ":domcore", ":errors", ":events", - ":html5", ":inject", ":json", ":locators", diff --git a/javascript/atoms/fragments/BUILD.bazel b/javascript/atoms/fragments/BUILD.bazel index 2bbe6e6678fc2..f489ef328569f 100644 --- a/javascript/atoms/fragments/BUILD.bazel +++ b/javascript/atoms/fragments/BUILD.bazel @@ -53,18 +53,6 @@ closure_fragment( ], ) -closure_fragment( - name = "execute-sql", - function = "bot.storage.database.executeSql", - module = "bot.storage.database", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - "//javascript/atoms:html5", - ], -) - closure_fragment( name = "get-effective-style", function = "bot.dom.getEffectiveStyle", @@ -88,18 +76,6 @@ closure_fragment( ], ) -closure_fragment( - name = "get-location", - function = "bot.geolocation.getCurrentPosition", - module = "bot.geolocation", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - "//javascript/atoms:html5", - ], -) - closure_fragment( name = "get-size", function = "goog.style.getSize", diff --git a/javascript/atoms/html5/appcache.js b/javascript/atoms/html5/appcache.js deleted file mode 100644 index 64268bb836178..0000000000000 --- a/javascript/atoms/html5/appcache.js +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Atom to access application cache status. - * - */ - -goog.provide('bot.appcache'); - -goog.require('bot'); -goog.require('bot.Error'); -goog.require('bot.ErrorCode'); -goog.require('bot.html5'); - - -/** - * Returns the current state of the application cache. - * - * @param {Window=} opt_window The window object whose cache is checked; - * defaults to the main window. - * @return {number} The state. - */ -bot.appcache.getStatus = function(opt_window) { - var win = opt_window || bot.getWindow(); - - if (bot.html5.isSupported(bot.html5.API.APPCACHE, win)) { - return win.applicationCache.status; - } else { - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, - 'Undefined application cache'); - } -}; diff --git a/javascript/atoms/html5/database.js b/javascript/atoms/html5/database.js deleted file mode 100644 index 72817097fd04c..0000000000000 --- a/javascript/atoms/html5/database.js +++ /dev/null @@ -1,141 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Atoms for executing SQL queries on web client database. - * - */ - -goog.provide('bot.storage.database'); -goog.provide('bot.storage.database.ResultSet'); - -goog.require('bot'); -goog.require('bot.Error'); -goog.require('bot.ErrorCode'); - - -/** - * Opens the database to access its contents. This function will create the - * database if it does not exist. For details, - * @see http://www.w3.org/TR/webdatabase/#databases - * - * @param {string} databaseName The name of the database. - * @param {string=} opt_version The expected database version to be opened; - * defaults to the empty string. - * @param {string=} opt_displayName The name to be displayed to the user; - * defaults to the databaseName. - * @param {number=} opt_size The estimated initial quota size of the database; - * default value is 5MB. - * @param {!Window=} opt_window The window associated with the database; - * defaults to the main window. - * @return {!Database} The object to access the web database. - * - */ -bot.storage.database.openOrCreate = function(databaseName, opt_version, - opt_displayName, opt_size, opt_window) { - var version = opt_version || ''; - var displayName = opt_displayName || (databaseName + 'name'); - var size = opt_size || 5 * 1024 * 1024; - var win = opt_window || bot.getWindow(); - - return win.openDatabase(databaseName, version, displayName, size); -}; - - -/** - * It executes a single SQL query on a given web database storage. - * - * @param {string} databaseName The name of the database. - * @param {string} query The SQL statement. - * @param {!Array.<*>} args Arguments needed for the SQL statement. - * @param {!function(!SQLTransaction, !bot.storage.database.ResultSet)} - * queryResultCallback Callback function to be invoked on successful query - * statement execution. - * @param {!function(!SQLError)} txErrorCallback - * Callback function to be invoked on transaction (commit) failure. - * @param {!function()=} opt_txSuccessCallback - * Callback function to be invoked on successful transaction execution. - * @param {function(!SQLTransaction, !SQLError)=} opt_queryErrorCallback - * Callback function to be invoked on successful query statement execution. - * @see http://www.w3.org/TR/webdatabase/#executing-sql-statements - */ -bot.storage.database.executeSql = function(databaseName, query, args, - queryResultCallback, txErrorCallback, opt_txSuccessCallback, - opt_queryErrorCallback) { - - var db; - - try { - db = bot.storage.database.openOrCreate(databaseName); - } catch (e) { - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, e.message); - } - - var queryCallback = function(tx, result) { - var wrappedResult = new bot.storage.database.ResultSet(result); - queryResultCallback(tx, wrappedResult); - }; - - var transactionCallback = function(tx) { - tx.executeSql(query, args, queryCallback, opt_queryErrorCallback); - }; - - db.transaction(transactionCallback, txErrorCallback, - opt_txSuccessCallback); -}; - - - -/** - * A wrapper of the SQLResultSet object returned by the SQL statement. - * - * @param {!SQLResultSet} sqlResultSet The original SQLResultSet object. - * @constructor - */ -bot.storage.database.ResultSet = function(sqlResultSet) { - - /** - * The database rows returned from the SQL query. - * @type {!Array.<*>} - */ - this.rows = []; - for (var i = 0; i < sqlResultSet.rows.length; i++) { - this.rows[i] = sqlResultSet.rows.item(i); - } - - /** - * The number of rows that were changed by the SQL statement - * @type {number} - */ - this.rowsAffected = sqlResultSet.rowsAffected; - - /** - * The row ID of the row that the SQLResultSet object's SQL statement - * inserted into the database, if the statement inserted a row; else - * it is assigned to -1. Originally, accessing insertId attribute of - * a SQLResultSet object returns the exception INVALID_ACCESS_ERR - * if no rows are inserted. - * @type {number} - */ - this.insertId = -1; - try { - this.insertId = sqlResultSet.insertId; - } catch (error) { - // If accessing sqlResultSet.insertId results in INVALID_ACCESS_ERR - // exception, this.insertId will be assigned to -1. - } -}; diff --git a/javascript/atoms/html5/html5_browser.js b/javascript/atoms/html5/html5_browser.js deleted file mode 100644 index 465ab4f441150..0000000000000 --- a/javascript/atoms/html5/html5_browser.js +++ /dev/null @@ -1,153 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Helper function to determine which HTML5 features are - * supported by browsers.. - */ - -goog.provide('bot.html5'); - -goog.require('bot'); -goog.require('bot.Error'); -goog.require('bot.ErrorCode'); -goog.require('bot.userAgent'); -goog.require('goog.userAgent'); -goog.require('goog.userAgent.product'); - - -/** - * Identifier for supported HTML5 API in Webdriver. - * - * @enum {string} - */ -bot.html5.API = { - APPCACHE: 'appcache', - BROWSER_CONNECTION: 'browser_connection', - DATABASE: 'database', - GEOLOCATION: 'location', - LOCAL_STORAGE: 'local_storage', - SESSION_STORAGE: 'session_storage', - VIDEO: 'video', - AUDIO: 'audio', - CANVAS: 'canvas' -}; - - -/** - * True if the current browser is IE version 8 or earlier. - * @private {boolean} - * @const - */ -bot.html5.IS_IE8_OR_EARLIER_ = goog.userAgent.IE && - !bot.userAgent.isEngineVersion(9); - - -/** - * True if the current browser is Safari version 4 or earlier. - * @private {boolean} - * @const - */ -bot.html5.IS_SAFARI4_OR_EARLIER_ = goog.userAgent.product.SAFARI && - !bot.userAgent.isProductVersion(5); - - -/** - * True if the browser is Android version 2.2 (Froyo) or earlier. - * @private {boolean} - * @const - */ -bot.html5.IS_ANDROID_FROYO_OR_EARLIER_ = goog.userAgent.product.ANDROID && - !bot.userAgent.isProductVersion(2.3); - - -/** - * True if the current browser is Safari 5 on Windows. - * @private {boolean} - * @const - */ -bot.html5.IS_SAFARI_WINDOWS_ = goog.userAgent.WINDOWS && - goog.userAgent.product.SAFARI && - (bot.userAgent.isProductVersion(4)) && - !bot.userAgent.isProductVersion(6); - - -/** - * Checks if the browser supports an HTML5 feature. - * - * @param {bot.html5.API} api HTML5 API identifier. - * @param {!Window=} opt_window The window to be accessed; - * defaults to the main window. - * @return {boolean} Whether the browser supports the feature. - */ -bot.html5.isSupported = function(api, opt_window) { - var win = opt_window || bot.getWindow(); - - switch (api) { - case bot.html5.API.APPCACHE: - // IE8 does not support application cache, though the APIs exist. - if (bot.html5.IS_IE8_OR_EARLIER_) { - return false; - } - return win.applicationCache != null; - - case bot.html5.API.BROWSER_CONNECTION: - return win.navigator != null && - win.navigator.onLine != null; - - case bot.html5.API.DATABASE: - // Safari4 database API does not allow writes. - if (bot.html5.IS_SAFARI4_OR_EARLIER_) { - return false; - } - // Android Froyo does not support database, though the APIs exist. - if (bot.html5.IS_ANDROID_FROYO_OR_EARLIER_) { - return false; - } - return win.openDatabase != null; - - case bot.html5.API.GEOLOCATION: - // Safari 4,5 on Windows do not support geolocation, see: - // https://discussions.apple.com/thread/3547900 - if (bot.html5.IS_SAFARI_WINDOWS_) { - return false; - } - return win.navigator != null && - win.navigator.geolocation != null; - - case bot.html5.API.LOCAL_STORAGE: - // IE8 does not support local storage, though the APIs exist. - if (bot.html5.IS_IE8_OR_EARLIER_) { - return false; - } - return win.localStorage != null; - - case bot.html5.API.SESSION_STORAGE: - // IE8 does not support session storage, though the APIs exist. - if (bot.html5.IS_IE8_OR_EARLIER_) { - return false; - } - return win.sessionStorage != null && - // To avoid browsers that only support this API partially - // like some versions of FF. - win.sessionStorage.clear != null; - - default: - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, - 'Unsupported API identifier provided as parameter'); - } -}; diff --git a/javascript/atoms/html5/location.js b/javascript/atoms/html5/location.js deleted file mode 100644 index 6018081b9cc02..0000000000000 --- a/javascript/atoms/html5/location.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Atom to retrieve the physical location of the device. - * - */ - -goog.provide('bot.geolocation'); - -goog.require('bot'); -goog.require('bot.Error'); -goog.require('bot.ErrorCode'); -goog.require('bot.html5'); - - -/** - * Default parameters used to configure the geolocation.getCurrentPosition - * method. These parameters mean retrieval of any cached position with high - * accuracy within a timeout interval of 5s. - * @const - * @type {!GeolocationPositionOptions} - * @see http://dev.w3.org/geo/api/spec-source.html#position-options - */ -bot.geolocation.DEFAULT_OPTIONS = /** @type {!GeolocationPositionOptions} */ ({ - enableHighAccuracy: true, - maximumAge: Infinity, - timeout: 5000 -}); - - -/** - * Provides a mechanism to retrieve the geolocation of the device. It invokes - * the navigator.geolocation.getCurrentPosition method of the HTML5 API which - * later callbacks with either position value or any error. The position/ - * error is updated with the callback functions. - * - * @param {function(?GeolocationPosition)} successCallback The callback method - * which is invoked on success. - * @param {function(?GeolocationPositionError)=} opt_errorCallback The callback - * method which is invoked on error. - * @param {?GeolocationPositionOptions=} opt_options The optional parameters to - * navigator.geolocation.getCurrentPosition; defaults to - * bot.geolocation.DEFAULT_OPTIONS. - */ -bot.geolocation.getCurrentPosition = function(successCallback, - opt_errorCallback, opt_options) { - var win = bot.getWindow(); - var posOptions = opt_options || bot.geolocation.DEFAULT_OPTIONS; - - if (bot.html5.isSupported(bot.html5.API.GEOLOCATION, win)) { - var geolocation = win.navigator.geolocation; - geolocation.getCurrentPosition(successCallback, - opt_errorCallback, posOptions); - } else { - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, 'Geolocation undefined'); - } -}; diff --git a/javascript/atoms/html5/storage.js b/javascript/atoms/html5/storage.js deleted file mode 100644 index 44f524d67ec18..0000000000000 --- a/javascript/atoms/html5/storage.js +++ /dev/null @@ -1,197 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Atoms for accessing HTML5 web storage maps (localStorage, - * sessionStorage). These storage objects store each item as a key-value - * mapping pair. - * - */ - -goog.provide('bot.storage'); -goog.provide('bot.storage.Storage'); - -goog.require('bot'); -goog.require('bot.Error'); -goog.require('bot.ErrorCode'); -goog.require('bot.html5'); - - -/** - * A factory method to create a wrapper to access the HTML5 localStorage - * object. - * Note: We are not using Closure from goog.storage, - * Closure uses "window" object directly, which may not always be - * defined (for example in firefox extensions). - * We use bot.window() from bot.js instead to keep track of the window or frame - * is currently being used for command execution. The implementation is - * otherwise similar to the implementation in the Closure library - * (goog.storage.mechanism.HTML5LocalStorage). - * - * @param {Window=} opt_window The window whose storage to access; - * defaults to the main window. - * @return {!bot.storage.Storage} The wrapper Storage object. - */ -bot.storage.getLocalStorage = function(opt_window) { - var win = opt_window || bot.getWindow(); - - if (!bot.html5.isSupported(bot.html5.API.LOCAL_STORAGE, win)) { - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, 'Local storage undefined'); - } - var storageMap = win.localStorage; - return new bot.storage.Storage(storageMap); -}; - - -/** - * A factory method to create a wrapper to access the HTML5 sessionStorage - * object. - * - * @param {Window=} opt_window The window whose storage to access; - * defaults to the main window. - * @return {!bot.storage.Storage} The wrapper Storage object. - */ -bot.storage.getSessionStorage = function(opt_window) { - var win = opt_window || bot.getWindow(); - - if (bot.html5.isSupported(bot.html5.API.SESSION_STORAGE, win)) { - var storageMap = win.sessionStorage; - return new bot.storage.Storage(storageMap); - } - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, - 'Session storage undefined'); -}; - - - -/** - * Provides a wrapper object to the HTML5 web storage object. - * @constructor - * - * @param {Storage} storageMap HTML5 storage object e.g. localStorage, - * sessionStorage. - */ -bot.storage.Storage = function(storageMap) { - /** - * Member variable to access the assigned HTML5 storage object. - * @private {Storage} - * @const - */ - this.storageMap_ = storageMap; -}; - - -/** - * Sets the value item of a key/value pair in the Storage object. - * If the value given is null, the string 'null' will be inserted - * instead. - * - * @param {string} key The key of the item. - * @param {*} value The value of the item. - */ -bot.storage.Storage.prototype.setItem = function(key, value) { - try { - // Note: Ideally, browsers should set a null value. But the browsers - // report arbitrarily. Firefox returns , while Chrome reports - // the string "null". We are setting the value to the string "null". - this.storageMap_.setItem(key, value + ''); - } catch (e) { - throw new bot.Error(bot.ErrorCode.UNKNOWN_ERROR, e.message); - } -}; - - -/** - * Returns the value item of a key in the Storage object. - * - * @param {string} key The key of the returned value. - * @return {?string} The mapped value if present in the storage object, - * otherwise null. If a null value was inserted for a given - * key, then the string 'null' is returned. - */ -bot.storage.Storage.prototype.getItem = function(key) { - var value = this.storageMap_.getItem(key); - return /** @type {?string} */ (value); -}; - - -/** - * Returns an array of keys of all keys of the Storage object. - * - * @return {!Array.} The array of stored keys.. - */ -bot.storage.Storage.prototype.keySet = function() { - var keys = []; - var length = this.size(); - for (var i = 0; i < length; i++) { - keys[i] = this.storageMap_.key(i); - } - return keys; -}; - - -/** - * Removes an item with a given key. - * - * @param {string} key The key item of the key/value pair. - * @return {?string} The removed value if present, otherwise null. - */ -bot.storage.Storage.prototype.removeItem = function(key) { - var value = this.getItem(key); - this.storageMap_.removeItem(key); - return value; -}; - - -/** - * Removes all items. - */ -bot.storage.Storage.prototype.clear = function() { - this.storageMap_.clear(); -}; - - -/** - * Returns the number of items in the Storage object. - * - * @return {number} The number of the key/value pairs. - */ -bot.storage.Storage.prototype.size = function() { - return this.storageMap_.length; -}; - - -/** - * Returns the key item of the key/value pairs in the Storage object - * of a given index. - * - * @param {number} index The index of the key/value pair list. - * @return {?string} The key item of a given index. - */ -bot.storage.Storage.prototype.key = function(index) { - return this.storageMap_.key(index); -}; - - -/** - * Returns HTML5 storage object of the wrapper Storage object - * - * @return {Storage} The storageMap attribute. - */ -bot.storage.Storage.prototype.getStorageMap = function() { - return this.storageMap_; -}; diff --git a/javascript/chrome-driver/BUILD.bazel b/javascript/chrome-driver/BUILD.bazel index d01ce71ff1a66..f049c1b5f3e5a 100644 --- a/javascript/chrome-driver/BUILD.bazel +++ b/javascript/chrome-driver/BUILD.bazel @@ -93,31 +93,15 @@ ATOMS = [ "//javascript/atoms/fragments:click-chrome", "//javascript/atoms/fragments:execute-async-script-chrome", "//javascript/atoms/fragments:execute-script-chrome", - "//javascript/atoms/fragments:execute-sql-chrome", "//javascript/atoms/fragments:find-elements-chrome", "//javascript/atoms/fragments:get-effective-style-chrome", "//javascript/atoms/fragments:get-size-chrome", "//javascript/atoms/fragments:is-displayed-chrome", "//javascript/atoms/fragments:is-enabled-chrome", "//javascript/atoms/fragments:submit-chrome", - "//javascript/webdriver/atoms:clear-local-storage-chrome", - "//javascript/webdriver/atoms:clear-session-storage-chrome", - "//javascript/webdriver/atoms:get-appcache-status-chrome", "//javascript/webdriver/atoms:get-attribute-chrome", - "//javascript/webdriver/atoms:get-local-storage-item-chrome", - "//javascript/webdriver/atoms:get-local-storage-key-chrome", - "//javascript/webdriver/atoms:get-local-storage-keys-chrome", - "//javascript/webdriver/atoms:get-local-storage-size-chrome", - "//javascript/webdriver/atoms:get-session-storage-item-chrome", - "//javascript/webdriver/atoms:get-session-storage-key-chrome", - "//javascript/webdriver/atoms:get-session-storage-keys-chrome", - "//javascript/webdriver/atoms:get-session-storage-size-chrome", "//javascript/webdriver/atoms:get-text-chrome", "//javascript/webdriver/atoms:is-selected-chrome", - "//javascript/webdriver/atoms:remove-local-storage-item-chrome", - "//javascript/webdriver/atoms:remove-session-storage-item-chrome", - "//javascript/webdriver/atoms:set-local-storage-item-chrome", - "//javascript/webdriver/atoms:set-session-storage-item-chrome", ] closure_lang_file( diff --git a/javascript/selenium-webdriver/lib/test/fileserver.js b/javascript/selenium-webdriver/lib/test/fileserver.js index 7023cd8d6fe3b..4524c52e065f9 100644 --- a/javascript/selenium-webdriver/lib/test/fileserver.js +++ b/javascript/selenium-webdriver/lib/test/fileserver.js @@ -72,7 +72,6 @@ const Pages = (function () { addPage('framesetPage', 'frameset.html') addPage('grandchildPage', 'child/grandchild/grandchildPage.html') addPage('html5Page', 'html5Page.html') - addPage('html5OfflinePage', 'html5/offline.html') addPage('iframePage', 'iframes.html') addPage('javascriptEnhancedForm', 'javascriptEnhancedForm.html') addPage('javascriptPage', 'javascriptPage.html') diff --git a/javascript/webdriver/atoms/BUILD.bazel b/javascript/webdriver/atoms/BUILD.bazel index 9284e5fe62a97..d2127d4da40f9 100644 --- a/javascript/webdriver/atoms/BUILD.bazel +++ b/javascript/webdriver/atoms/BUILD.bazel @@ -20,10 +20,7 @@ closure_js_library( closure_js_library( name = "atoms-lib", - srcs = glob([ - "*.js", - "storage/*.js", - ]), + srcs = glob(["*.js"]), suppress = [ "JSC_IMPLICITLY_NULLABLE_JSDOC", "JSC_USE_OF_GOOG_PROVIDE", @@ -34,7 +31,6 @@ closure_js_library( "//javascript/atoms:devices", "//javascript/atoms:dom", "//javascript/atoms:domcore", - "//javascript/atoms:html5", "//javascript/webdriver:key", "//third_party/closure/goog/array", "//third_party/closure/goog/dom", @@ -60,45 +56,6 @@ closure_js_library( ], ) -closure_fragment( - name = "clear-local-storage", - function = "webdriver.atoms.storage.local.clear", - module = "webdriver.atoms.storage.local", - suppress = [ - "JSC_USE_OF_GOOG_PROVIDE", - ], - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - "//javascript/webdriver/atoms:atoms-lib", - ], -) - -closure_fragment( - name = "clear-session-storage", - function = "webdriver.atoms.storage.session.clear", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - "//javascript/webdriver/atoms:atoms-lib", - ], -) - -closure_fragment( - name = "get-appcache-status", - function = "webdriver.atoms.storage.appcache.getStatus", - module = "webdriver.atoms.storage.appcache", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - "//javascript/webdriver/atoms:atoms-lib", - ], -) - closure_fragment( name = "get-attribute", function = "webdriver.atoms.element.attribute.get", @@ -117,102 +74,6 @@ closure_fragment( ], ) -closure_fragment( - name = "get-local-storage-item", - function = "webdriver.atoms.storage.local.getItem", - module = "webdriver.atoms.storage.local", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-local-storage-key", - function = "webdriver.atoms.storage.local.key", - module = "webdriver.atoms.storage.local", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-local-storage-keys", - function = "webdriver.atoms.storage.local.keySet", - module = "webdriver.atoms.storage.local", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-local-storage-size", - function = "webdriver.atoms.storage.local.size", - module = "webdriver.atoms.storage.local", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-session-storage-item", - function = "webdriver.atoms.storage.session.getItem", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-session-storage-key", - function = "webdriver.atoms.storage.session.key", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-session-storage-keys", - function = "webdriver.atoms.storage.session.keySet", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "get-session-storage-size", - function = "webdriver.atoms.storage.session.size", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - closure_fragment( name = "get-text", function = "webdriver.atoms.element.getText", @@ -239,54 +100,6 @@ closure_fragment( ], ) -closure_fragment( - name = "remove-local-storage-item", - function = "webdriver.atoms.storage.local.removeItem", - module = "webdriver.atoms.storage.local", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "remove-session-storage-item", - function = "webdriver.atoms.storage.session.removeItem", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "set-local-storage-item", - function = "webdriver.atoms.storage.local.setItem", - module = "webdriver.atoms.storage.local", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - -closure_fragment( - name = "set-session-storage-item", - function = "webdriver.atoms.storage.session.setItem", - module = "webdriver.atoms.storage.session", - visibility = [ - "//javascript/chrome-driver:__pkg__", - ], - deps = [ - ":atoms-lib", - ], -) - closure_js_library( name = "all_js_for_testing", testonly = 1, diff --git a/javascript/webdriver/atoms/inject/BUILD.bazel b/javascript/webdriver/atoms/inject/BUILD.bazel index 9fabb7ceb22a7..f4558375fcd59 100644 --- a/javascript/webdriver/atoms/inject/BUILD.bazel +++ b/javascript/webdriver/atoms/inject/BUILD.bazel @@ -14,14 +14,10 @@ closure_js_deps( ], deps = [ ":action", - ":appcache", ":dom", ":execute-script", ":find-element", ":frame", - ":local-storage", - ":session-storage", - ":sql-database", ], ) @@ -42,18 +38,6 @@ closure_js_library( ], ) -closure_js_library( - name = "appcache", - srcs = ["appcache.js"], - suppress = [ - "JSC_USE_OF_GOOG_PROVIDE", - ], - deps = [ - "//javascript/atoms:inject", - "//javascript/webdriver/atoms:atoms-lib", - ], -) - closure_js_library( name = "dom", srcs = ["dom.js"], @@ -113,45 +97,6 @@ closure_js_library( ], ) -closure_js_library( - name = "local-storage", - srcs = ["local_storage.js"], - suppress = [ - "JSC_USE_OF_GOOG_PROVIDE", - ], - deps = [ - ":execute-script", - "//javascript/webdriver/atoms:atoms-lib", - ], -) - -closure_js_library( - name = "session-storage", - srcs = ["session_storage.js"], - suppress = [ - "JSC_USE_OF_GOOG_PROVIDE", - ], - deps = [ - ":execute-script", - "//javascript/webdriver/atoms:atoms-lib", - ], -) - -closure_js_library( - name = "sql-database", - srcs = ["sql_database.js"], - suppress = [ - "JSC_USE_OF_GOOG_PROVIDE", - ], - deps = [ - ":execute-script", - "//javascript/atoms:errors", - "//javascript/atoms:html5", - "//javascript/atoms:inject", - "//javascript/webdriver/atoms:atoms-lib", - ], -) - closure_fragment( name = "active-element", function = "webdriver.atoms.inject.frame.activeElement", @@ -182,24 +127,6 @@ closure_fragment( ], ) -closure_fragment( - name = "clear-local-storage", - function = "webdriver.atoms.inject.storage.local.clear", - module = "webdriver.atoms.inject.storage.local", - deps = [ - ":local-storage", - ], -) - -closure_fragment( - name = "clear-session-storage", - function = "webdriver.atoms.inject.storage.session.clear", - module = "webdriver.atoms.inject.storage.session", - deps = [ - ":session-storage", - ], -) - closure_fragment( name = "default-content", function = "webdriver.atoms.inject.frame.defaultContent", @@ -263,48 +190,6 @@ closure_fragment( ], ) -closure_fragment( - name = "get-local-storage-item", - function = "webdriver.atoms.inject.storage.local.getItem", - module = "webdriver.atoms.inject.storage.local", - deps = [":local-storage"], -) - -closure_fragment( - name = "get-local-storage-keys", - function = "webdriver.atoms.inject.storage.local.keySet", - module = "webdriver.atoms.inject.storage.local", - deps = [":local-storage"], -) - -closure_fragment( - name = "get-local-storage-size", - function = "webdriver.atoms.inject.storage.local.size", - module = "webdriver.atoms.inject.storage.local", - deps = [":local-storage"], -) - -closure_fragment( - name = "get-session-storage-item", - function = "webdriver.atoms.inject.storage.session.getItem", - module = "webdriver.atoms.inject.storage.session", - deps = [":session-storage"], -) - -closure_fragment( - name = "get-session-storage-keys", - function = "webdriver.atoms.inject.storage.session.keySet", - module = "webdriver.atoms.inject.storage.session", - deps = [":session-storage"], -) - -closure_fragment( - name = "get-session-storage-size", - function = "webdriver.atoms.inject.storage.session.size", - module = "webdriver.atoms.inject.storage.session", - deps = [":session-storage"], -) - closure_fragment( name = "get-size", function = "webdriver.atoms.inject.dom.getSize", @@ -354,34 +239,6 @@ closure_fragment( deps = [":dom"], ) -closure_fragment( - name = "remove-local-storage-item", - function = "webdriver.atoms.inject.storage.local.removeItem", - module = "webdriver.atoms.inject.storage.local", - deps = [":local-storage"], -) - -closure_fragment( - name = "remove-session-storage-item", - function = "webdriver.atoms.inject.storage.session.removeItem", - module = "webdriver.atoms.inject.storage.session", - deps = [":session-storage"], -) - -closure_fragment( - name = "set-local-storage-item", - function = "webdriver.atoms.inject.storage.local.setItem", - module = "webdriver.atoms.inject.storage.local", - deps = [":local-storage"], -) - -closure_fragment( - name = "set-session-storage-item", - function = "webdriver.atoms.inject.storage.session.setItem", - module = "webdriver.atoms.inject.storage.session", - deps = [":session-storage"], -) - closure_fragment( name = "submit", function = "webdriver.atoms.inject.action.submit", @@ -397,10 +254,3 @@ closure_fragment( ":action", ], ) - -closure_fragment( - name = "get-appcache-status", - function = "webdriver.atoms.inject.storage.appcache.getStatus", - module = "webdriver.atoms.inject.storage.appcache", - deps = [":appcache"], -) diff --git a/javascript/webdriver/atoms/inject/appcache.js b/javascript/webdriver/atoms/inject/appcache.js deleted file mode 100644 index acce636459e0b..0000000000000 --- a/javascript/webdriver/atoms/inject/appcache.js +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Ready to inject atoms for handling application cache. - */ - -goog.provide('webdriver.atoms.inject.storage.appcache'); - -goog.require('bot.inject'); -goog.require('webdriver.atoms.storage.appcache'); - - -/** - * Gets the status of the application cache. - * - * @return {string} The status of the application cache. - */ -webdriver.atoms.inject.storage.appcache.getStatus = function() { - return /**@type {string}*/(bot.inject.executeScript( - webdriver.atoms.storage.appcache.getStatus, [], true)); -}; diff --git a/javascript/webdriver/atoms/inject/local_storage.js b/javascript/webdriver/atoms/inject/local_storage.js deleted file mode 100644 index 6039e0c8da50c..0000000000000 --- a/javascript/webdriver/atoms/inject/local_storage.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Ready to inject atoms for handling local storage. - */ - -goog.provide('webdriver.atoms.inject.storage.local'); - -goog.require('webdriver.atoms.inject'); -goog.require('webdriver.atoms.storage.local'); - - -/** - * Sets an item in the local storage. - * - * @param {string} key The key of the item. - * @param {*} value The value of the item. - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.local.setItem = function(key, value) { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.local.setItem, [key, value]); -}; - - -/** - * Gets an item from the local storage. - * - * @param {string} key The key of the item. - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.local.getItem = function(key) { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.local.getItem, [key]); -}; - - -/** - * Gets the key set of the entries. - * - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.local.keySet = function() { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.local.keySet, []); -}; - - -/** - * Removes an item in the local storage. - * - * @param {string} key The key of the item. - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.local.removeItem = function(key) { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.local.removeItem, [key]); -}; - - -/** - * Clears the local storage. - * - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.local.clear = function() { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.local.clear, []); -}; - - -/** - * Gets the size of the local storage. - * - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.local.size = function() { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.local.size, []); -}; diff --git a/javascript/webdriver/atoms/inject/session_storage.js b/javascript/webdriver/atoms/inject/session_storage.js deleted file mode 100644 index 6d511f1291f1a..0000000000000 --- a/javascript/webdriver/atoms/inject/session_storage.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Ready to inject atoms for handling session storage. - */ - -goog.provide('webdriver.atoms.inject.storage.session'); - -goog.require('webdriver.atoms.inject'); -goog.require('webdriver.atoms.storage.session'); - - -/** - * Sets an item in the session storage. - * - * @param {string} key The key of the item. - * @param {*} value The value of the item. - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.session.setItem = function(key, value) { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.session.setItem, [key, value]); -}; - - -/** - * Gets an item from the session storage. - * - * @param {string} key The key of the item. - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.session.getItem = function(key) { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.session.getItem, [key]); -}; - - -/** - * Gets the key set of the entries. - * - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.session.keySet = function() { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.session.keySet, []); -}; - - -/** - * Removes an item in the session storage. - * - * @param {string} key The key of the item. - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.session.removeItem = function(key) { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.session.removeItem, [key]); -}; - - -/** - * Clears the session storage. - * - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.session.clear = function() { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.session.clear, []); -}; - - -/** - * Gets the size of the session storage. - * - * @return {string} The stringified result wrapped according to the wire - * protocol. - */ -webdriver.atoms.inject.storage.session.size = function() { - return webdriver.atoms.inject.executeScript( - webdriver.atoms.storage.session.size, []); -}; diff --git a/javascript/webdriver/atoms/inject/sql_database.js b/javascript/webdriver/atoms/inject/sql_database.js deleted file mode 100644 index 8fb10798674fa..0000000000000 --- a/javascript/webdriver/atoms/inject/sql_database.js +++ /dev/null @@ -1,57 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Ready to inject atoms for handling web SQL database. - */ - -goog.provide('webdriver.atoms.inject.storage.database'); - -goog.require('bot.Error'); -goog.require('bot.ErrorCode'); -goog.require('bot.storage.database'); -goog.require('webdriver.atoms.inject'); - - -/** - * Executes the given query in the Web SQL database specified. - * - * @param {string} databaseName The name of the database. - * @param {string} query The SQL statement. - * @param {Array.<*>} args Arguments to pass to the query. - * @param {function(string)} onDone The callback to invoke when done. The - * result, according to the wire protocol, will be passed to this callback. - */ -webdriver.atoms.inject.storage.database.executeSql = - function(databaseName, query, args, onDone) { - var onSuccessCallback = function(tx, result) { - onDone(webdriver.atoms.inject.executeScript(function(res) { - return result; - }, [result])); - }; - - var onErrorCallback = function(error) { - onDone(webdriver.atoms.inject.executeScript(function() { - throw new bot.Error(bot.ErrorCode.SQL_DATABASE_ERROR, - 'SQL Error Code: ' + error.code + '. SQL Error Message: ' + - error.message); - }, [])); - }; - - bot.storage.database.executeSql( - databaseName, query, args, onSuccessCallback, onErrorCallback); -}; diff --git a/javascript/webdriver/atoms/storage/appcache.js b/javascript/webdriver/atoms/storage/appcache.js deleted file mode 100644 index b80d0aebb86f8..0000000000000 --- a/javascript/webdriver/atoms/storage/appcache.js +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Utility functions for accessing HTML5 appcache object. - * These functions are wrapper of the functions of individual method of - * bot.storage.Storage class. An extra redirection is used to define - * individual functional unit (atom) for injecting in Webdriver. - */ - -goog.provide('webdriver.atoms.storage.appcache'); - -goog.require('bot.appcache'); - - -/** - * Returns the status of the appcache. - * @return {number} status of the appcache. - */ -webdriver.atoms.storage.appcache.getStatus = function() { - return bot.appcache.getStatus(); -}; diff --git a/javascript/webdriver/atoms/storage/local_storage.js b/javascript/webdriver/atoms/storage/local_storage.js deleted file mode 100644 index d52e3c43845bf..0000000000000 --- a/javascript/webdriver/atoms/storage/local_storage.js +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Utility functions for accessing HTML5 localStorage object. - * These functions are wrapper of the functions of individual method of - * bot.storage.Storage class. An extra redirection is used to define - * individual functional unit (atom) for injecting in Webdriver. - */ - -goog.provide('webdriver.atoms.storage.local'); - -goog.require('bot.storage'); - - -/** - * Utility function to set the value of a key/value pair in localStorage. - * @param {string} key The key of the item. - * @param {*} value The value of the item. - */ -webdriver.atoms.storage.local.setItem = function(key, value) { - bot.storage.getLocalStorage().setItem(key, value); -}; - - -/** - * Returns the value item of a key in the localStorage object. - * @param {string} key The key of the returned value. - * @return {?string} The mapped value if present in the localStorage object, - * otherwise null. - */ -webdriver.atoms.storage.local.getItem = function(key) { - return bot.storage.getLocalStorage().getItem(key); -}; - - -/** - * Returns an array of keys of all keys of the localStorage object. - * @return {Array.} The array of stored keys. - */ -webdriver.atoms.storage.local.keySet = function() { - return bot.storage.getLocalStorage().keySet(); -}; - - -/** - * Removes an item with a given key. - * @param {string} key The key of the key/value pair. - * @return {?string} The removed value if present, otherwise null. - */ -webdriver.atoms.storage.local.removeItem = function(key) { - return bot.storage.getLocalStorage().removeItem(key); -}; - - -/** - * Removes all items from the localStorage object. - */ -webdriver.atoms.storage.local.clear = function() { - bot.storage.getLocalStorage().clear(); -}; - - -/** - * Returns the number of items in the localStorage object. - * @return {number} The number of the key/value pairs. - */ -webdriver.atoms.storage.local.size = function() { - return bot.storage.getLocalStorage().size(); -}; - - -/** - * Returns the key item of the key/value pairs in the localStorage object - * of a given index. - * @param {number} index The index of the key/value pair list. - * @return {?string} The key item of a given index. - */ -webdriver.atoms.storage.local.key = function(index) { - return bot.storage.getLocalStorage().key(index); -}; - diff --git a/javascript/webdriver/atoms/storage/session_storage.js b/javascript/webdriver/atoms/storage/session_storage.js deleted file mode 100644 index 474d9f535b7fc..0000000000000 --- a/javascript/webdriver/atoms/storage/session_storage.js +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Utility functions for accessing HTML5 sessionStorage object. - * These functions are wrapper of the functions of individual method of - * bot.storage.Storage class. An extra redirection is used to define - * individual functional unit (atom) for injecting in Webdriver. - */ - -goog.provide('webdriver.atoms.storage.session'); - -goog.require('bot.storage'); - - -/** - * Utility function to set the value of a key/value pair in sessionStorage. - * @param {string} key The key of the item. - * @param {*} value The value of the item. - */ -webdriver.atoms.storage.session.setItem = function(key, value) { - bot.storage.getSessionStorage().setItem(key, value); -}; - - -/** - * Returns the value item of a key in the sessionStorage object. - * @param {string} key The key of the returned value. - * @return {?string} The mapped value if present in the sessionStorage object, - * otherwise null. - */ -webdriver.atoms.storage.session.getItem = function(key) { - return bot.storage.getSessionStorage().getItem(key); -}; - - -/** - * Returns an array of keys of all keys of the sessionStorage object. - * @return {Array.} The array of stored keys.. - */ -webdriver.atoms.storage.session.keySet = function() { - return bot.storage.getSessionStorage().keySet(); -}; - - -/** - * Removes an item with a given key. - * @param {string} key The key of the key/value pair. - * @return {?string} The removed value if present, otherwise null. - */ -webdriver.atoms.storage.session.removeItem = function(key) { - return bot.storage.getSessionStorage().removeItem(key); -}; - - -/** - * Removes all items from the sessionStorage object. - */ -webdriver.atoms.storage.session.clear = function() { - bot.storage.getSessionStorage().clear(); -}; - - -/** - * Returns the number of items in the sessionStorage object. - * @return {number} The number of the key/value pairs. - */ -webdriver.atoms.storage.session.size = function() { - return bot.storage.getSessionStorage().size(); -}; - - -/** - * Returns the key item of the key/value pairs in the sessionStorage object - * of a given index. - * @param {number} index The index of the key/value pair list. - * @return {?string} The key item of a given index. - */ -webdriver.atoms.storage.session.key = function(index) { - return bot.storage.getSessionStorage().key(index); -}; - diff --git a/javascript/webdriver/command.js b/javascript/webdriver/command.js index aa615c3aba39b..1c6fb3f8163bf 100644 --- a/javascript/webdriver/command.js +++ b/javascript/webdriver/command.js @@ -174,29 +174,6 @@ webdriver.CommandName = { GET_ALERT_TEXT: 'getAlertText', SET_ALERT_TEXT: 'setAlertValue', - EXECUTE_SQL: 'executeSQL', - GET_LOCATION: 'getLocation', - SET_LOCATION: 'setLocation', - GET_APP_CACHE: 'getAppCache', - GET_APP_CACHE_STATUS: 'getStatus', - CLEAR_APP_CACHE: 'clearAppCache', - IS_BROWSER_ONLINE: 'isBrowserOnline', - SET_BROWSER_ONLINE: 'setBrowserOnline', - - GET_LOCAL_STORAGE_ITEM: 'getLocalStorageItem', - GET_LOCAL_STORAGE_KEYS: 'getLocalStorageKeys', - SET_LOCAL_STORAGE_ITEM: 'setLocalStorageItem', - REMOVE_LOCAL_STORAGE_ITEM: 'removeLocalStorageItem', - CLEAR_LOCAL_STORAGE: 'clearLocalStorage', - GET_LOCAL_STORAGE_SIZE: 'getLocalStorageSize', - - GET_SESSION_STORAGE_ITEM: 'getSessionStorageItem', - GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey', - SET_SESSION_STORAGE_ITEM: 'setSessionStorageItem', - REMOVE_SESSION_STORAGE_ITEM: 'removeSessionStorageItem', - CLEAR_SESSION_STORAGE: 'clearSessionStorage', - GET_SESSION_STORAGE_SIZE: 'getSessionStorageSize', - SET_SCREEN_ORIENTATION: 'setScreenOrientation', GET_SCREEN_ORIENTATION: 'getScreenOrientation',