Unreviewed. Remove W3C deleted files after r231727.
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2018 08:38:10 +0000 (08:38 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2018 08:38:10 +0000 (08:38 +0000)
In r231727 W3C WebDriver tests were updated, but only new and modified files, not the deleted (or renamed)
ones. Remove the deleted files and update the test expectations to use the new names.

* TestExpectations.json: Update expectations after test renames in r231727.
* imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette.js: Removed.
* imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette_resume.js: Removed.
* imported/w3c/webdriver/tests/contexts/json_serialize_windowproxy.py: Removed.
* imported/w3c/webdriver/tests/contexts/maximize_window.py: Removed.
* imported/w3c/webdriver/tests/contexts/resizing_and_positioning.py: Removed.
* imported/w3c/webdriver/tests/cookies/add_cookie.py: Removed.
* imported/w3c/webdriver/tests/cookies/delete_cookie.py: Removed.
* imported/w3c/webdriver/tests/cookies/get_named_cookie.py: Removed.
* imported/w3c/webdriver/tests/document_handling/page_source.py: Removed.
* imported/w3c/webdriver/tests/element_retrieval/__init__.py: Removed.
* imported/w3c/webdriver/tests/element_retrieval/find_element.py: Removed.
* imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py: Removed.
* imported/w3c/webdriver/tests/element_retrieval/find_elements.py: Removed.
* imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py: Removed.
* imported/w3c/webdriver/tests/element_retrieval/get_active_element.py: Removed.
* imported/w3c/webdriver/tests/fullscreen_window.py: Removed.
* imported/w3c/webdriver/tests/get_window_rect.py: Removed.
* imported/w3c/webdriver/tests/interaction/element_clear.py: Removed.
* imported/w3c/webdriver/tests/interaction/send_keys_content_editable.py: Removed.
* imported/w3c/webdriver/tests/minimize_window.py: Removed.
* imported/w3c/webdriver/tests/navigation/current_url.py: Removed.
* imported/w3c/webdriver/tests/navigation/get_title.py: Removed.
* imported/w3c/webdriver/tests/sessions/get_timeouts.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/conftest.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/create_alwaysMatch.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/create_firstMatch.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/default_values.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/merge.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/response.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/support/__init__.py: Removed.
* imported/w3c/webdriver/tests/sessions/new_session/support/create.py: Removed.
* imported/w3c/webdriver/tests/sessions/status.py: Removed.
* imported/w3c/webdriver/tests/set_window_rect.py: Removed.
* imported/w3c/webdriver/tests/state/__init__.py: Removed.
* imported/w3c/webdriver/tests/state/get_element_attribute.py: Removed.
* imported/w3c/webdriver/tests/state/get_element_property.py: Removed.
* imported/w3c/webdriver/tests/state/get_element_tag_name.py: Removed.
* imported/w3c/webdriver/tests/state/is_element_selected.py: Removed.
* imported/w3c/webdriver/tests/state/text/__init__.py: Removed.
* imported/w3c/webdriver/tests/state/text/get_text.py: Removed.
* imported/w3c/webdriver/tests/switch_to_parent_frame.py: Removed.
* imported/w3c/webdriver/tests/user_prompts/accept_alert.py: Removed.
* imported/w3c/webdriver/tests/user_prompts/dismiss_alert.py: Removed.
* imported/w3c/webdriver/tests/user_prompts/get_alert_text.py: Removed.
* imported/w3c/webdriver/tests/user_prompts/send_alert_text.py: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231841 268f45cc-cd09-0410-ab3c-d52691b4dbfc

48 files changed:
WebDriverTests/ChangeLog
WebDriverTests/TestExpectations.json
WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette.js [deleted file]
WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette_resume.js [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/contexts/json_serialize_windowproxy.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/contexts/maximize_window.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/contexts/resizing_and_positioning.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/cookies/add_cookie.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/cookies/delete_cookie.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/cookies/get_named_cookie.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/document_handling/page_source.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/__init__.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_element.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_elements.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/get_active_element.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/fullscreen_window.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/get_window_rect.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/interaction/element_clear.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/interaction/send_keys_content_editable.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/minimize_window.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/navigation/current_url.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/navigation/get_title.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/get_timeouts.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/conftest.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/create_alwaysMatch.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/create_firstMatch.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/default_values.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/merge.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/support/__init__.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/support/create.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/sessions/status.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/set_window_rect.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/__init__.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/get_element_attribute.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/get_element_property.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/get_element_tag_name.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/is_element_selected.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/text/__init__.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/state/text/get_text.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/switch_to_parent_frame.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/user_prompts/accept_alert.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/user_prompts/dismiss_alert.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/user_prompts/get_alert_text.py [deleted file]
WebDriverTests/imported/w3c/webdriver/tests/user_prompts/send_alert_text.py [deleted file]

index 245de7e..be3b355 100644 (file)
@@ -1,3 +1,58 @@
+2018-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Unreviewed. Remove W3C deleted files after r231727.
+
+        In r231727 W3C WebDriver tests were updated, but only new and modified files, not the deleted (or renamed)
+        ones. Remove the deleted files and update the test expectations to use the new names.
+
+        * TestExpectations.json: Update expectations after test renames in r231727.
+        * imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette.js: Removed.
+        * imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette_resume.js: Removed.
+        * imported/w3c/webdriver/tests/contexts/json_serialize_windowproxy.py: Removed.
+        * imported/w3c/webdriver/tests/contexts/maximize_window.py: Removed.
+        * imported/w3c/webdriver/tests/contexts/resizing_and_positioning.py: Removed.
+        * imported/w3c/webdriver/tests/cookies/add_cookie.py: Removed.
+        * imported/w3c/webdriver/tests/cookies/delete_cookie.py: Removed.
+        * imported/w3c/webdriver/tests/cookies/get_named_cookie.py: Removed.
+        * imported/w3c/webdriver/tests/document_handling/page_source.py: Removed.
+        * imported/w3c/webdriver/tests/element_retrieval/__init__.py: Removed.
+        * imported/w3c/webdriver/tests/element_retrieval/find_element.py: Removed.
+        * imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py: Removed.
+        * imported/w3c/webdriver/tests/element_retrieval/find_elements.py: Removed.
+        * imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py: Removed.
+        * imported/w3c/webdriver/tests/element_retrieval/get_active_element.py: Removed.
+        * imported/w3c/webdriver/tests/fullscreen_window.py: Removed.
+        * imported/w3c/webdriver/tests/get_window_rect.py: Removed.
+        * imported/w3c/webdriver/tests/interaction/element_clear.py: Removed.
+        * imported/w3c/webdriver/tests/interaction/send_keys_content_editable.py: Removed.
+        * imported/w3c/webdriver/tests/minimize_window.py: Removed.
+        * imported/w3c/webdriver/tests/navigation/current_url.py: Removed.
+        * imported/w3c/webdriver/tests/navigation/get_title.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/get_timeouts.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/conftest.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/create_alwaysMatch.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/create_firstMatch.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/default_values.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/merge.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/response.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/support/__init__.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/new_session/support/create.py: Removed.
+        * imported/w3c/webdriver/tests/sessions/status.py: Removed.
+        * imported/w3c/webdriver/tests/set_window_rect.py: Removed.
+        * imported/w3c/webdriver/tests/state/__init__.py: Removed.
+        * imported/w3c/webdriver/tests/state/get_element_attribute.py: Removed.
+        * imported/w3c/webdriver/tests/state/get_element_property.py: Removed.
+        * imported/w3c/webdriver/tests/state/get_element_tag_name.py: Removed.
+        * imported/w3c/webdriver/tests/state/is_element_selected.py: Removed.
+        * imported/w3c/webdriver/tests/state/text/__init__.py: Removed.
+        * imported/w3c/webdriver/tests/state/text/get_text.py: Removed.
+        * imported/w3c/webdriver/tests/switch_to_parent_frame.py: Removed.
+        * imported/w3c/webdriver/tests/user_prompts/accept_alert.py: Removed.
+        * imported/w3c/webdriver/tests/user_prompts/dismiss_alert.py: Removed.
+        * imported/w3c/webdriver/tests/user_prompts/get_alert_text.py: Removed.
+        * imported/w3c/webdriver/tests/user_prompts/send_alert_text.py: Removed.
+
 2018-05-11  Brian Burg  <bburg@apple.com>
 
         Unreviewed. Update W3C WebDriver imported tests.
index 8f881b4..be149d4 100644 (file)
             }
         }
     },
-    "imported/w3c/webdriver/tests/contexts/maximize_window.py": {
+    "imported/w3c/webdriver/tests/maximize_window/maximize.py": {
+        "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
+    },
+    "imported/w3c/webdriver/tests/maximize_window/user_prompts.py": {
         "subtests": {
-            "test_no_browsing_context": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
-            },
             "test_handle_prompt_accept": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
             },
             "test_handle_prompt_missing_value": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
-            },
-            "test_fully_exit_fullscreen": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
-            },
-            "test_restore_the_window": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
-            },
-            "test_maximize": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
-            },
-            "test_payload": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
-            },
-            "test_maximize_twice_is_idempotent": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/contexts/json_serialize_windowproxy.py": {
+    "imported/w3c/webdriver/tests/execute_script/json_serialize_windowproxy.py": {
         "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180397"}}
     },
-    "imported/w3c/webdriver/tests/cookies/get_named_cookie.py": {
+    "imported/w3c/webdriver/tests/get_named_cookie/get.py": {
         "subtests": {
             "test_duplicated_cookie": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/182330"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/document_handling/page_source.py": {
+    "imported/w3c/webdriver/tests/page_source/source.py": {
         "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180399"}}
     },
     "imported/w3c/webdriver/tests/element_click/bubbling.py": {
             }
         }
     },
-    "imported/w3c/webdriver/tests/element_retrieval/find_element.py": {
+    "imported/w3c/webdriver/tests/find_element/find.py": {
         "subtests": {
             "test_find_element_link_text[<a href=#>link<br>text</a>-link\ntext]": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184964"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/element_retrieval/find_elements.py": {
+    "imported/w3c/webdriver/tests/find_elements/find.py": {
         "subtests": {
             "test_find_elements_link_text[<a href=#>link<br>text</a>-link\ntext]": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184964"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py": {
+    "imported/w3c/webdriver/tests/find_elements_from_element/find.py": {
         "subtests": {
             "test_find_elements_link_text[<a href=#>link<br>text</a>-link\ntext]": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184964"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py": {
+    "imported/w3c/webdriver/tests/find_element_from_element/find.py": {
         "subtests": {
             "test_find_element_link_text[<a href=#>link<br>text</a>-link\ntext]": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184964"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/interaction/send_keys_content_editable.py": {
+    "imported/w3c/webdriver/tests/element_send_keys/content_editable.py": {
         "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180403"}}
     },
-    "imported/w3c/webdriver/tests/interaction/element_clear.py": {
+    "imported/w3c/webdriver/tests/element_clear/clear.py": {
         "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180404"}},
         "subtests": {
             "test_no_browsing_context": {
             }
         }
     },
-    "imported/w3c/webdriver/tests/navigation/current_url.py": {
+    "imported/w3c/webdriver/tests/get_current_url/get.py": {
         "subtests": {
             "test_set_malformed_url": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180405"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py": {
+    "imported/w3c/webdriver/tests/new_session/invalid_capabilities.py": {
         "subtests": {
             "test_invalid_values[proxy-1-body0]": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180408"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/sessions/new_session/default_values.py": {
+    "imported/w3c/webdriver/tests/new_session/default_values.py": {
         "subtests": {
             "test_valid_but_unmatchable_key": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180410"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/state/get_element_property.py": {
+    "imported/w3c/webdriver/tests/get_element_property/get.py": {
         "subtests": {
             "test_element_not_found": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180413"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/state/get_element_attribute.py": {
+    "imported/w3c/webdriver/tests/get_element_attribute/get.py": {
         "subtests": {
             "test_element_not_found": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180413"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/state/get_element_tag_name.py": {
+    "imported/w3c/webdriver/tests/get_element_tag_name/get.py": {
         "subtests": {
             "test_element_not_found": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180413"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/state/text/get_text.py": {
+    "imported/w3c/webdriver/tests/get_element_text/get.py": {
         "subtests": {
             "test_getting_text_of_a_non_existant_element_is_an_error": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180413"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/fullscreen_window.py": {
+    "imported/w3c/webdriver/tests/fullscreen_window/fullscreen.py": {
+        "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
+    },
+    "imported/w3c/webdriver/tests/fullscreen_window/user_prompts.py": {
         "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}},
         "subtests": {
             "test_handle_prompt_dismiss_and_notify": {
             }
         }
     },
-    "imported/w3c/webdriver/tests/minimize_window.py": {
-        "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}},
+    "imported/w3c/webdriver/tests/minimize_window/minimize.py": {
+        "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
+    },
+    "imported/w3c/webdriver/tests/minimize_window/user_prompts.py": {
         "subtests": {
-            "test_handle_prompt_dismiss_and_notify": {
-                "expected": {"all": {"status": ["PASS"]}}
-            },
-            "test_handle_prompt_accept_and_notify": {
-                "expected": {"all": {"status": ["PASS"]}}
+            "test_handle_prompt_accept": {
+                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
             },
-            "test_handle_prompt_ignore": {
-                "expected": {"all": {"status": ["PASS"]}}
+            "test_handle_prompt_missing_value": {
+                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
             }
         }
     },
-    "imported/w3c/webdriver/tests/set_window_rect.py": {
+    "imported/w3c/webdriver/tests/set_window_rect/set.py": {
         "subtests": {
             "test_fully_exit_fullscreen": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180398"}}
diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette.js b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette.js
deleted file mode 100644 (file)
index 049caa4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-window.timeout_multiplier = %(timeout_multiplier)d;
-window.explicit_timeout = %(explicit_timeout)d;
-
-window.message_queue = [];
-
-window.setMessageListener = function(func) {
-  window.current_listener = func;
-  window.addEventListener(
-    "message",
-    func,
-    false
-  );
-};
-
-window.setMessageListener(function(event) {
-  window.message_queue.push(event);
-});
-
-window.win = window.open("%(abs_url)s", "%(window_id)s");
-
-window.timer = setTimeout(function() {
-  window.win.timeout();
-  window.win.close();
-}, %(timeout)s);
diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette_resume.js b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette_resume.js
deleted file mode 100644 (file)
index 7a2df98..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-var callback = arguments[arguments.length - 1];
-
-function process_event(event) {
-  var data = event.data;
-
-  var payload = undefined;
-
-  switch(data.type) {
-  case "complete":
-    var tests = event.data.tests;
-    var status = event.data.status;
-
-    var subtest_results = tests.map(function(x) {
-      return [x.name, x.status, x.message, x.stack];
-    });
-    payload = [status.status,
-               status.message,
-               status.stack,
-               subtest_results];
-    clearTimeout(window.timer);
-    break;
-
-  case "action":
-    window.setMessageListener(function(event) {
-      window.message_queue.push(event);
-    });
-    payload = data;
-    break;
-  default:
-    return;
-  }
-
-  callback(["%(url)s", data.type, payload]);
-}
-
-window.removeEventListener("message", window.current_listener);
-if (window.message_queue.length) {
-  var next = window.message_queue.shift();
-  process_event(next);
-} else {
-  window.addEventListener(
-    "message", function f(event) {
-      window.removeEventListener("message", f);
-      process_event(event);
-    }, false);
-}
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/contexts/json_serialize_windowproxy.py b/WebDriverTests/imported/w3c/webdriver/tests/contexts/json_serialize_windowproxy.py
deleted file mode 100644 (file)
index 49507c8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# META: timeout=long
-
-import json
-
-
-_window_id = "window-fcc6-11e5-b4f8-330a88ab9d7f"
-_frame_id = "frame-075b-4da1-b6ba-e579c2d3230a"
-
-def test_initial_window(session):
-    # non-auxiliary top-level browsing context
-    raw_json = session.execute_script("return window;")
-    obj = json.loads(raw_json)
-    assert len(obj) == 1
-    assert _window_id in obj
-    handle = obj[_window_id]
-    assert handle in session.window_handles
-
-
-def test_window_open(session):
-    # auxiliary browsing context
-    session.execute_script("window.foo = window.open()")
-    raw_json = session.execute_script("return window.foo;")
-    obj = json.loads(raw_json)
-    assert len(obj) == 1
-    assert _window_id in obj
-    handle = obj[_window_id]
-    assert handle in session.window_handles
-
-
-def test_frame(session):
-    # nested browsing context
-    append = """
-        window.frame = document.createElement('iframe');
-        document.body.appendChild(frame);
-    """
-    session.execute_script(append)
-    raw_json = session.execute_script("return frame.contentWindow;")
-    obj = json.loads(raw_json)
-    assert len(obj) == 1
-    assert _frame_id in obj
-    handle = obj[_frame_id]
-    assert handle not in session.window_handles
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/contexts/maximize_window.py b/WebDriverTests/imported/w3c/webdriver/tests/contexts/maximize_window.py
deleted file mode 100644 (file)
index 6143dc1..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-# META: timeout=long
-
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-alert_doc = inline("<script>window.alert()</script>")
-
-
-def maximize(session):
-    return session.transport.send("POST", "session/%s/window/maximize" % session.session_id)
-
-
-def is_fullscreen(session):
-    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
-    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
-    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
-
-
-# 10.7.3 Maximize Window
-
-
-def test_no_browsing_context(session, create_window):
-    """
-    2. If the current top-level browsing context is no longer open,
-    return error with error code no such window.
-
-    """
-    session.window_handle = create_window()
-    session.close()
-    response = maximize(session)
-    assert_error(response, "no such window")
-
-
-def test_handle_prompt_dismiss_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_ignore():
-    """TODO"""
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    """
-    3. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - accept state
-           Accept the current user prompt.
-
-    """
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<title>WD doc title</title>")
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-    response = maximize(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-    response = maximize(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-    response = maximize(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session, create_dialog):
-    """
-    3. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - missing value default state
-           1. Dismiss the current user prompt.
-           2. Return error with error code unexpected alert open.
-
-    """
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = maximize(session)
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = maximize(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = maximize(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_fully_exit_fullscreen(session):
-    """
-    4. Fully exit fullscreen.
-
-    [...]
-
-    To fully exit fullscreen a document document, run these steps:
-
-      1. If document's fullscreen element is null, terminate these steps.
-
-      2. Unfullscreen elements whose fullscreen flag is set, within
-      document's top layer, except for document's fullscreen element.
-
-      3. Exit fullscreen document.
-
-    """
-    session.window.fullscreen()
-    assert is_fullscreen(session) is True
-
-    response = maximize(session)
-    assert_success(response)
-    assert is_fullscreen(session) is False
-
-
-def test_restore_the_window(session):
-    """
-    5. Restore the window.
-
-    [...]
-
-    To restore the window, given an operating system level window with
-    an associated top-level browsing context, run implementation-specific
-    steps to restore or unhide the window to the visible screen.  Do not
-    return from this operation until the visibility state of the top-level
-    browsing context's active document has reached the visible state,
-    or until the operation times out.
-
-    """
-    session.window.minimize()
-    assert session.execute_script("return document.hidden") is True
-
-    response = maximize(session)
-    assert_success(response)
-
-
-def test_maximize(session):
-    """
-    6. Maximize the window of the current browsing context.
-
-    [...]
-
-    To maximize the window, given an operating system level window with an
-    associated top-level browsing context, run the implementation-specific
-    steps to transition the operating system level window into the
-    maximized window state.  If the window manager supports window
-    resizing but does not have a concept of window maximation, the window
-    dimensions must be increased to the maximum available size permitted
-    by the window manager for the current screen.  Return when the window
-    has completed the transition, or within an implementation-defined
-    timeout.
-
-    """
-    before_size = session.window.size
-
-    response = maximize(session)
-    assert_success(response)
-
-    assert before_size != session.window.size
-
-
-def test_payload(session):
-    """
-    7. Return success with the JSON serialization of the current top-level
-    browsing context's window rect.
-
-    [...]
-
-    A top-level browsing context's window rect is defined as a
-    dictionary of the screenX, screenY, width and height attributes of
-    the WindowProxy. Its JSON representation is the following:
-
-    "x"
-        WindowProxy's screenX attribute.
-
-    "y"
-        WindowProxy's screenY attribute.
-
-    "width"
-        Width of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    "height"
-        Height of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    """
-    before_size = session.window.size
-
-    response = maximize(session)
-
-    # step 5
-    assert response.status == 200
-    assert isinstance(response.body["value"], dict)
-
-    value = response.body["value"]
-    assert "width" in value
-    assert "height" in value
-    assert "x" in value
-    assert "y" in value
-    assert isinstance(value["width"], int)
-    assert isinstance(value["height"], int)
-    assert isinstance(value["x"], int)
-    assert isinstance(value["y"], int)
-
-    assert before_size != session.window.size
-
-
-def test_maximize_twice_is_idempotent(session):
-    first_response = maximize(session)
-    assert_success(first_response)
-    max_size = session.window.size
-
-    second_response = maximize(session)
-    assert_success(second_response)
-    assert session.window.size == max_size
-
-
-"""
-TODO(ato): Implicit session start does not use configuration passed on
-from wptrunner.  This causes an exception.
-
-See https://bugzil.la/1398459.
-
-def test_maximize_when_resized_to_max_size(session):
-    # Determine the largest available window size by first maximising
-    # the window and getting the window rect dimensions.
-    #
-    # Then resize the window to the maximum available size.
-    session.end()
-    available = session.window.maximize()
-    session.end()
-
-    session.window.size = available
-
-    # In certain window managers a window extending to the full available
-    # dimensions of the screen may not imply that the window is maximised,
-    # since this is often a special state.  If a remote end expects a DOM
-    # resize event, this may not fire if the window has already reached
-    # its expected dimensions.
-    before = session.window.size
-    session.window.maximize()
-    assert session.window.size == before
-"""
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/contexts/resizing_and_positioning.py b/WebDriverTests/imported/w3c/webdriver/tests/contexts/resizing_and_positioning.py
deleted file mode 100644 (file)
index 66331fa..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-import json
-import pytest
-import webdriver
-
-
-def window_size_supported(session):
-    try:
-        session.window.size = ("a", "b")
-    except webdriver.UnsupportedOperationException:
-        return False
-    except webdriver.InvalidArgumentException:
-        return True
-
-def window_position_supported(session):
-    try:
-        session.window.position = ("a", "b")
-    except webdriver.UnsupportedOperationException:
-        return False
-    except webdriver.InvalidArgumentException:
-        return True
-
-
-def test_window_resize(session):
-    if not window_size_supported(session):
-        pytest.skip()
-
-    # setting the window size by webdriver is synchronous
-    # so we should see the results immediately
-
-    session.window.size = (400, 500)
-    assert session.window.size == (400, 500)
-
-    session.window.size = (500, 600)
-    assert session.window.size == (500, 600)
-
-
-"""
-TODO(ato):
-
-    Disable test because the while statements are wrong.
-    To fix this properly we need to write an explicit wait utility.
-
-def test_window_resize_by_script(session):
-    # setting the window size by JS is asynchronous
-    # so we poll waiting for the results
-
-    size0 = session.window.size
-
-    session.execute_script("window.resizeTo(700, 800)")
-    size1 = session.window.size
-    while size0 == size1:
-        size1 = session.window.size
-    assert size1 == (700, 800)
-
-    session.execute_script("window.resizeTo(800, 900)")
-    size2 = session.window.size
-    while size1 == size2:
-        size2 = session.window.size
-        assert size2 == (800, 900)
-    assert size2 == {"width": 200, "height": 100}
-"""
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/cookies/add_cookie.py b/WebDriverTests/imported/w3c/webdriver/tests/cookies/add_cookie.py
deleted file mode 100644 (file)
index 88b79fb..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-from tests.support.fixtures import clear_all_cookies
-from datetime import datetime, timedelta
-
-def test_add_domain_cookie(session, url, server_config):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-    create_cookie_request = {
-        "cookie": {
-            "name": "hello",
-            "value": "world",
-            "domain": server_config["domains"][""],
-            "path": "/",
-            "httpOnly": False,
-            "secure": False
-        }
-    }
-    result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request)
-    assert result.status == 200
-    assert "value" in result.body
-    assert result.body["value"] is None
-
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    assert "domain" in cookie
-    assert isinstance(cookie["domain"], basestring)
-
-    assert cookie["name"] == "hello"
-    assert cookie["value"] == "world"
-    assert cookie["domain"] == ".%s" % server_config["domains"][""] or cookie["domain"] == "%s" % server_config["domains"][""]
-
-def test_add_cookie_for_ip(session, url, server_config, configuration):
-    session.url = "http://127.0.0.1:%s/common/blank.html" % (server_config["ports"]["http"][0])
-    clear_all_cookies(session)
-    create_cookie_request = {
-        "cookie": {
-            "name": "hello",
-            "value": "world",
-            "domain": "127.0.0.1",
-            "path": "/",
-            "httpOnly": False,
-            "secure": False
-        }
-    }
-
-    result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request)
-    assert result.status == 200
-    assert "value" in result.body
-    assert result.body["value"] is None
-
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    assert "domain" in cookie
-    assert isinstance(cookie["domain"], basestring)
-
-    assert cookie["name"] == "hello"
-    assert cookie["value"] == "world"
-    assert cookie["domain"] == "127.0.0.1"
-
-def test_add_non_session_cookie(session, url):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-    a_year_from_now = int((datetime.utcnow() + timedelta(days=365) - datetime.utcfromtimestamp(0)).total_seconds())
-    create_cookie_request = {
-        "cookie": {
-            "name": "hello",
-            "value": "world",
-            "expiry": a_year_from_now
-        }
-    }
-    result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request)
-    assert result.status == 200
-    assert "value" in result.body
-    assert result.body["value"] is None
-
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    assert "expiry" in cookie
-    assert isinstance(cookie["expiry"], int)
-
-    assert cookie["name"] == "hello"
-    assert cookie["value"] == "world"
-    assert cookie["expiry"] == a_year_from_now
-
-def test_add_session_cookie(session, url):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-    create_cookie_request = {
-        "cookie": {
-            "name": "hello",
-            "value": "world"
-        }
-    }
-    result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request)
-    assert result.status == 200
-    assert "value" in result.body
-    assert result.body["value"] is None
-
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    if "expiry" in cookie:
-        assert cookie.get("expiry") is None
-
-    assert cookie["name"] == "hello"
-    assert cookie["value"] == "world"
-
-def test_add_session_cookie_with_leading_dot_character_in_domain(session, url, server_config):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-    create_cookie_request = {
-        "cookie": {
-            "name": "hello",
-            "value": "world",
-            "domain": ".%s" % server_config["domains"][""]
-        }
-    }
-    result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request)
-    assert result.status == 200
-    assert "value" in result.body
-    assert result.body["value"] is None
-
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    assert "domain" in cookie
-    assert isinstance(cookie["domain"], basestring)
-
-    assert cookie["name"] == "hello"
-    assert cookie["value"] == "world"
-    assert cookie["domain"] == ".%s" % server_config["domains"][""] or cookie["domain"] == "%s" % server_config["domains"][""]
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/cookies/delete_cookie.py b/WebDriverTests/imported/w3c/webdriver/tests/cookies/delete_cookie.py
deleted file mode 100644 (file)
index 813ee88..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-def delete_cookie(session, name):
-    return session.transport.send("DELETE", "/session/%s/cookie/%s" % (session.session_id, name))
-
-
-# 16.4 Delete Cookie
-
-
-def test_no_browsing_context(session, create_window):
-    """
-    1. If the current top-level browsing context is no longer open,
-    return error with error code no such window.
-
-    """
-    session.window_handle = create_window()
-    session.close()
-    response = delete_cookie(session, "foo")
-    assert_error(response, "no such window")
-
-
-def test_handle_prompt_dismiss_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_ignore():
-    """TODO"""
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - accept state
-           Accept the current user prompt.
-
-    """
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<title>WD doc title</title>")
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-    response = delete_cookie(session, "foo")
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-    response = delete_cookie(session, "foo")
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-    response = delete_cookie(session, "foo")
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session, create_dialog):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - missing value default state
-           1. Dismiss the current user prompt.
-           2. Return error with error code unexpected alert open.
-
-    """
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = delete_cookie(session, "foo")
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = delete_cookie(session, "foo")
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = delete_cookie(session, "foo")
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_unknown_cookie(session):
-    response = delete_cookie(session, "stilton")
-    assert response.status == 200
-    assert "value" in response.body
-    assert response.body["value"] is None
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/cookies/get_named_cookie.py b/WebDriverTests/imported/w3c/webdriver/tests/cookies/get_named_cookie.py
deleted file mode 100644 (file)
index 806dda3..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-from tests.support.inline import inline
-from tests.support.fixtures import clear_all_cookies
-from datetime import datetime, timedelta
-
-def test_get_named_session_cookie(session, url):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-    session.execute_script("document.cookie = 'foo=bar'")
-
-    result = session.transport.send("GET", "session/%s/cookie/foo" % session.session_id)
-    assert result.status == 200
-    assert isinstance(result.body["value"], dict)
-
-    # table for cookie conversion
-    # https://w3c.github.io/webdriver/webdriver-spec.html#dfn-table-for-cookie-conversion
-    cookie = result.body["value"]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    assert "path" in cookie
-    assert isinstance(cookie["path"], basestring)
-    assert "domain" in cookie
-    assert isinstance(cookie["domain"], basestring)
-    assert "secure" in cookie
-    assert isinstance(cookie["secure"], bool)
-    assert "httpOnly" in cookie
-    assert isinstance(cookie["httpOnly"], bool)
-    if "expiry" in cookie:
-        assert cookie.get("expiry") is None
-
-    assert cookie["name"] == "foo"
-    assert cookie["value"] == "bar"
-
-def test_get_named_cookie(session, url):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-
-    # same formatting as Date.toUTCString() in javascript
-    utc_string_format = "%a, %d %b %Y %H:%M:%S"
-    a_year_from_now = (datetime.utcnow() + timedelta(days=365)).strftime(utc_string_format)
-    session.execute_script("document.cookie = 'foo=bar;expires=%s'" % a_year_from_now)
-
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-    assert "expiry" in cookie
-    assert isinstance(cookie["expiry"], (int, long))
-
-    assert cookie["name"] == "foo"
-    assert cookie["value"] == "bar"
-    # convert from seconds since epoch
-    assert datetime.utcfromtimestamp(cookie["expiry"]).strftime(utc_string_format) == a_year_from_now
-
-def test_duplicated_cookie(session, url, server_config):
-    session.url = url("/common/blank.html")
-    clear_all_cookies(session)
-    create_cookie_request = {
-        "cookie": {
-            "name": "hello",
-            "value": "world",
-            "domain": server_config["domains"][""],
-            "path": "/",
-            "httpOnly": False,
-            "secure": False
-        }
-    }
-    result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request)
-    assert result.status == 200
-    assert "value" in result.body
-    assert result.body["value"] is None
-
-    session.url = inline("<script>document.cookie = 'hello=newworld; domain=%s; path=/';</script>" % server_config["domains"][""])
-    result = session.transport.send("GET", "session/%s/cookie" % session.session_id)
-    assert result.status == 200
-    assert "value" in result.body
-    assert isinstance(result.body["value"], list)
-    assert len(result.body["value"]) == 1
-    assert isinstance(result.body["value"][0], dict)
-
-    cookie = result.body["value"][0]
-    assert "name" in cookie
-    assert isinstance(cookie["name"], basestring)
-    assert "value" in cookie
-    assert isinstance(cookie["value"], basestring)
-
-    assert cookie["name"] == "hello"
-    assert cookie["value"] == "newworld"
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/document_handling/page_source.py b/WebDriverTests/imported/w3c/webdriver/tests/document_handling/page_source.py
deleted file mode 100644 (file)
index 04eae6f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-import pytest
-
-from tests.support.inline import inline
-
-
-# 15.1.3 "Let source be the result returned from the outerHTML IDL attribute
-#         of the document element"
-def test_source_matches_outer_html(session):
-    session.url = inline("<html><head><title>Cheese</title><body>Peas")
-    expected_source = session.execute_script(
-        "return document.documentElement.outerHTML")
-
-    assert session.source == expected_source
-
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/__init__.py b/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_element.py b/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_element.py
deleted file mode 100644 (file)
index dddb28c..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-import pytest
-
-from tests.support.asserts import assert_error, assert_same_element, assert_success
-from tests.support.inline import inline
-
-
-def find_element(session, using, value):
-    return session.transport.send("POST",
-                                  "session/%s/element" % session.session_id,
-                                  {"using": using, "value": value})
-
-
-# 12.2 Find Element
-
-@pytest.mark.parametrize("using", ["a", True, None, 1, [], {}])
-def test_invalid_using_argument(session, using):
-    # Step 1 - 2
-    response = find_element(session, using, "value")
-    assert_error(response, "invalid argument")
-
-
-@pytest.mark.parametrize("value", [None, [], {}])
-def test_invalid_selector_argument(session, value):
-    # Step 3 - 4
-    response = find_element(session, "css selector", value)
-    assert_error(response, "invalid argument")
-
-
-def test_closed_context(session, create_window):
-    # Step 5
-    new_window = create_window()
-    session.window_handle = new_window
-    session.close()
-
-    response = find_element(session, "css selector", "foo")
-
-    assert_error(response, "no such window")
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//a")])
-def test_find_element(session, using, value):
-    # Step 8 - 9
-    session.url = inline("<a href=# id=linkText>full link text</a>")
-
-    response = find_element(session, using, value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>link text</a>", "link text"),
-    ("<a href=#>&nbsp;link text&nbsp;</a>", "link text"),
-    ("<a href=#>link<br>text</a>", "link\ntext"),
-    ("<a href=#>link&amp;text</a>", "link&text"),
-    ("<a href=#>LINK TEXT</a>", "LINK TEXT"),
-    ("<a href=# style='text-transform: uppercase'>link text</a>", "LINK TEXT"),
-])
-def test_find_element_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline(document)
-
-    response = find_element(session, "link text", value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>partial link text</a>", "link"),
-    ("<a href=#>&nbsp;partial link text&nbsp;</a>", "link"),
-    ("<a href=#>partial link text</a>", "k t"),
-    ("<a href=#>partial link<br>text</a>", "k\nt"),
-    ("<a href=#>partial link&amp;text</a>", "k&t"),
-    ("<a href=#>PARTIAL LINK TEXT</a>", "LINK"),
-    ("<a href=# style='text-transform: uppercase'>partial link text</a>", "LINK"),
-])
-def test_find_element_partial_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline(document)
-
-    response = find_element(session, "partial link text", value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("using,value", [("css selector", "#wontExist")])
-def test_no_element(session, using, value):
-    # Step 8 - 9
-    response = find_element(session, using, value)
-    assert_error(response, "no such element")
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//*[name()='a']")])
-def test_xhtml_namespace(session, using, value):
-    session.url = inline("""<a href="#" id="linkText">full link text</a>""",
-                         doctype="xhtml")
-    expected = session.execute_script("return document.links[0]")
-
-    response = find_element(session, using, value)
-    value = assert_success(response)
-    assert_same_element(session, value, expected)
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", ":root"),
-                          ("tag name", "html"),
-                          ("xpath", "/html")])
-def test_htmldocument(session, using, value):
-    session.url = inline("")
-    response = find_element(session, using, value)
-    assert_success(response)
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py b/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py
deleted file mode 100644 (file)
index f6b9858..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-import pytest
-
-from tests.support.asserts import assert_error, assert_same_element, assert_success
-from tests.support.inline import inline
-
-
-def find_element(session, element, using, value):
-    return session.transport.send("POST",
-                                  "session/%s/element/%s/element" % (session.session_id, element),
-                                  {"using": using, "value": value})
-
-
-@pytest.mark.parametrize("using", ["a", True, None, 1, [], {}])
-def test_invalid_using_argument(session, using):
-    # Step 1 - 2
-    response = find_element(session, "notReal", using, "value")
-    assert_error(response, "invalid argument")
-
-
-@pytest.mark.parametrize("value", [None, [], {}])
-def test_invalid_selector_argument(session, value):
-    # Step 3 - 4
-    response = find_element(session, "notReal", "css selector", value)
-    assert_error(response, "invalid argument")
-
-
-def test_closed_context(session, create_window):
-    # Step 5
-    new_window = create_window()
-    session.window_handle = new_window
-    session.close()
-
-    response = find_element(session, "notReal", "css selector", "foo")
-    assert_error(response, "no such window")
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//a")])
-def test_find_element(session, using, value):
-    # Step 8 - 9
-    session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
-    element = session.find.css("div", all=False)
-    response = find_element(session, element.id, using, value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>link text</a>", "link text"),
-    ("<a href=#>&nbsp;link text&nbsp;</a>", "link text"),
-    ("<a href=#>link<br>text</a>", "link\ntext"),
-    ("<a href=#>link&amp;text</a>", "link&text"),
-    ("<a href=#>LINK TEXT</a>", "LINK TEXT"),
-    ("<a href=# style='text-transform: uppercase'>link text</a>", "LINK TEXT"),
-])
-def test_find_element_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline("<div>{0}</div>".format(document))
-    element = session.find.css("div", all=False)
-
-    response = find_element(session, element.id, "link text", value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>partial link text</a>", "link"),
-    ("<a href=#>&nbsp;partial link text&nbsp;</a>", "link"),
-    ("<a href=#>partial link text</a>", "k t"),
-    ("<a href=#>partial link<br>text</a>", "k\nt"),
-    ("<a href=#>partial link&amp;text</a>", "k&t"),
-    ("<a href=#>PARTIAL LINK TEXT</a>", "LINK"),
-    ("<a href=# style='text-transform: uppercase'>partial link text</a>", "LINK"),
-])
-def test_find_element_partial_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline("<div>{0}</div>".format(document))
-    element = session.find.css("div", all=False)
-
-    response = find_element(session, element.id, "partial link text", value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("using,value",[("css selector", "#wontExist")])
-def test_no_element(session, using, value):
-    # Step 8 - 9
-    session.url = inline("<div></div>")
-    element = session.find.css("div", all=False)
-    response = find_element(session, element.id, using, value)
-    assert_error(response, "no such element")
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//*[name()='a']")])
-def test_xhtml_namespace(session, using, value):
-    session.url = inline("""<p><a href="#" id="linkText">full link text</a></p>""",
-                         doctype="xhtml")
-    from_element = session.execute_script("""return document.querySelector("p")""")
-    expected = session.execute_script("return document.links[0]")
-
-    response = find_element(session, from_element.id, using, value)
-    value = assert_success(response)
-    assert_same_element(session, value, expected)
-
-
-def test_parent_htmldocument(session):
-    session.url = inline("")
-    from_element = session.execute_script("""return document.querySelector("body")""")
-    expected = session.execute_script("return document.documentElement")
-
-    response = find_element(session, from_element.id, "xpath", "..")
-    value = assert_success(response)
-    assert_same_element(session, value, expected)
-
-
-def test_parent_of_document_node_errors(session):
-    session.url = inline("")
-    from_element = session.execute_script("return document.documentElement")
-
-    response = find_element(session, from_element.id, "xpath", "..")
-    assert_error(response, "invalid selector")
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_elements.py b/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_elements.py
deleted file mode 100644 (file)
index 781dd3b..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-import pytest
-
-from tests.support.asserts import assert_error, assert_same_element, assert_success
-from tests.support.inline import inline
-
-
-def find_elements(session, using, value):
-    return session.transport.send("POST",
-                                  "session/%s/elements" % session.session_id,
-                                  {"using": using, "value": value})
-
-
-@pytest.mark.parametrize("using", ["a", True, None, 1, [], {}])
-def test_invalid_using_argument(session, using):
-    # Step 1 - 2
-    response = find_elements(session, using, "value")
-    assert_error(response, "invalid argument")
-
-
-@pytest.mark.parametrize("value", [None, [], {}])
-def test_invalid_selector_argument(session, value):
-    # Step 3 - 4
-    response = find_elements(session, "css selector", value)
-    assert_error(response, "invalid argument")
-
-
-def test_closed_context(session, create_window):
-    # Step 5
-    new_window = create_window()
-    session.window_handle = new_window
-    session.close()
-
-    response = find_elements(session, "css selector", "foo")
-    assert_error(response, "no such window")
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//a")])
-def test_find_elements(session, using, value):
-    # Step 8 - 9
-    session.url = inline("<a href=# id=linkText>full link text</a>")
-
-    response = find_elements(session, using, value)
-    assert_success(response)
-    assert len(response.body["value"]) == 1
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>link text</a>", "link text"),
-    ("<a href=#>&nbsp;link text&nbsp;</a>", "link text"),
-    ("<a href=#>link<br>text</a>", "link\ntext"),
-    ("<a href=#>link&amp;text</a>", "link&text"),
-    ("<a href=#>LINK TEXT</a>", "LINK TEXT"),
-    ("<a href=# style='text-transform: uppercase'>link text</a>", "LINK TEXT"),
-])
-def test_find_elements_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline("<a href=#>not wanted</a><br/>{0}".format(document))
-    expected = session.execute_script("return document.links[1];")
-
-    response = find_elements(session, "link text", value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>partial link text</a>", "link"),
-    ("<a href=#>&nbsp;partial link text&nbsp;</a>", "link"),
-    ("<a href=#>partial link text</a>", "k t"),
-    ("<a href=#>partial link<br>text</a>", "k\nt"),
-    ("<a href=#>partial link&amp;text</a>", "k&t"),
-    ("<a href=#>PARTIAL LINK TEXT</a>", "LINK"),
-    ("<a href=# style='text-transform: uppercase'>partial link text</a>", "LINK"),
-])
-def test_find_elements_partial_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline("<a href=#>not wanted</a><br/>{0}".format(document))
-    expected = session.execute_script("return document.links[1];")
-
-    response = find_elements(session, "partial link text", value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-@pytest.mark.parametrize("using,value", [("css selector", "#wontExist")])
-def test_no_element(session, using, value):
-    # Step 8 - 9
-    response = find_elements(session, using, value)
-    assert_success(response)
-    assert response.body["value"] == []
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//*[name()='a']")])
-def test_xhtml_namespace(session, using, value):
-    session.url = inline("""<a href="#" id="linkText">full link text</a>""",
-                         doctype="xhtml")
-    expected = session.execute_script("return document.links[0];")
-
-    response = find_elements(session, using, value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", ":root"),
-                          ("tag name", "html"),
-                          ("xpath", "/html")])
-def test_htmldocument(session, using, value):
-    session.url = inline("")
-    response = find_elements(session, using, value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py b/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py
deleted file mode 100644 (file)
index 4dd8a4a..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-import pytest
-
-from tests.support.asserts import assert_error, assert_same_element, assert_success
-from tests.support.inline import inline
-
-
-def find_elements(session, element, using, value):
-    return session.transport.send("POST",
-                                  "session/%s/element/%s/elements" % (session.session_id, element),
-                                  {"using": using, "value": value})
-
-@pytest.mark.parametrize("using", [("a"), (True), (None), (1), ([]), ({})])
-def test_invalid_using_argument(session, using):
-    # Step 1 - 2
-    response = find_elements(session, "notReal", using, "value")
-    assert_error(response, "invalid argument")
-
-
-@pytest.mark.parametrize("value", [None, [], {}])
-def test_invalid_selector_argument(session, value):
-    # Step 3 - 4
-    response = find_elements(session, "notReal", "css selector", value)
-    assert_error(response, "invalid argument")
-
-
-def test_closed_context(session, create_window):
-    # Step 5
-    new_window = create_window()
-    session.window_handle = new_window
-    session.close()
-
-    response = find_elements(session, "notReal", "css selector", "foo")
-
-    assert_error(response, "no such window")
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//a")])
-def test_find_elements(session, using, value):
-    # Step 8 - 9
-    session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
-    element = session.find.css("div", all=False)
-    response = find_elements(session, element.id, using, value)
-    assert_success(response)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>link text</a>", "link text"),
-    ("<a href=#>&nbsp;link text&nbsp;</a>", "link text"),
-    ("<a href=#>link<br>text</a>", "link\ntext"),
-    ("<a href=#>link&amp;text</a>", "link&text"),
-    ("<a href=#>LINK TEXT</a>", "LINK TEXT"),
-    ("<a href=# style='text-transform: uppercase'>link text</a>", "LINK TEXT"),
-])
-def test_find_elements_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline("<div><a href=#>not wanted</a><br/>{0}</div>".format(document))
-    element = session.find.css("div", all=False)
-    expected = session.execute_script("return document.links[1];")
-
-    response = find_elements(session, element.id, "link text", value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-@pytest.mark.parametrize("document,value", [
-    ("<a href=#>partial link text</a>", "link"),
-    ("<a href=#>&nbsp;partial link text&nbsp;</a>", "link"),
-    ("<a href=#>partial link text</a>", "k t"),
-    ("<a href=#>partial link<br>text</a>", "k\nt"),
-    ("<a href=#>partial link&amp;text</a>", "k&t"),
-    ("<a href=#>PARTIAL LINK TEXT</a>", "LINK"),
-    ("<a href=# style='text-transform: uppercase'>partial link text</a>", "LINK"),
-])
-def test_find_elements_partial_link_text(session, document, value):
-    # Step 8 - 9
-    session.url = inline("<div><a href=#>not wanted</a><br/>{0}</div>".format(document))
-    element = session.find.css("div", all=False)
-    expected = session.execute_script("return document.links[1];")
-
-    response = find_elements(session, element.id, "partial link text", value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-@pytest.mark.parametrize("using,value", [("css selector", "#wontExist")])
-def test_no_element(session, using, value):
-    # Step 8 - 9
-    session.url = inline("<div></div>")
-    element = session.find.css("div", all=False)
-    response = find_elements(session, element.id, using, value)
-    assert response.body["value"] == []
-
-
-@pytest.mark.parametrize("using,value",
-                         [("css selector", "#linkText"),
-                          ("link text", "full link text"),
-                          ("partial link text", "link text"),
-                          ("tag name", "a"),
-                          ("xpath", "//*[name()='a']")])
-def test_xhtml_namespace(session, using, value):
-    session.url = inline("""<p><a href="#" id="linkText">full link text</a></p>""",
-                         doctype="xhtml")
-    from_element = session.execute_script("""return document.querySelector("p")""")
-    expected = session.execute_script("return document.links[0]")
-
-    response = find_elements(session, from_element.id, using, value)
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-def test_parent_htmldocument(session):
-    session.url = inline("")
-    from_element = session.execute_script("""return document.querySelector("body")""")
-    expected = session.execute_script("return document.documentElement")
-
-    response = find_elements(session, from_element.id, "xpath", "..")
-    value = assert_success(response)
-    assert isinstance(value, list)
-    assert len(value) == 1
-
-    found_element = value[0]
-    assert_same_element(session, found_element, expected)
-
-
-def test_parent_of_document_node_errors(session):
-    session.url = inline("")
-    from_element = session.execute_script("return document.documentElement")
-
-    response = find_elements(session, from_element.id, "xpath", "..")
-    assert_error(response, "invalid selector")
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/get_active_element.py b/WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/get_active_element.py
deleted file mode 100644 (file)
index af3e125..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_same_element
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-def read_global(session, name):
-    return session.execute_script("return %s;" % name)
-
-
-def get_active_element(session):
-    return session.transport.send("GET", "session/%s/element/active" % session.session_id)
-
-
-def assert_is_active_element(session, response):
-    """Ensure that the provided object is a successful WebDriver
-    response describing an element reference and that the referenced
-    element matches the element returned by the `activeElement`
-    attribute of the current browsing context's active document.
-
-    """
-    assert response.status == 200
-    assert "value" in response.body
-
-    from_js = session.execute_script("return document.activeElement")
-
-    if response.body["value"] is None:
-        assert from_js is None
-    else:
-        assert_same_element(session, response.body["value"], from_js)
-
-
-# > 1. If the current browsing context is no longer open, return error with
-# >    error code no such window.
-def test_closed_context(session, create_window):
-    new_window = create_window()
-    session.window_handle = new_window
-    session.close()
-
-    response = get_active_element(session)
-    assert_error(response, "no such window")
-
-
-# [...]
-# 2. Handle any user prompts and return its value if it is an error.
-# [...]
-# In order to handle any user prompts a remote end must take the following
-# steps:
-# 2. Run the substeps of the first matching user prompt handler:
-#
-#    [...]
-#    - dismiss state
-#      1. Dismiss the current user prompt.
-#    [...]
-#
-# 3. Return success.
-def test_handle_prompt_dismiss(new_session, add_browser_capabilites):
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "dismiss"})}})
-    session.url = inline("<body><p>Hello, World!</p></body>")
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-    assert_dialog_handled(session, "dismiss #1")
-    assert session.execute_script("return dismiss1") is None
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-    assert_dialog_handled(session, "dismiss #2")
-    assert read_global(session, "dismiss2") is False
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-    assert_dialog_handled(session, "dismiss #3")
-    assert read_global(session, "dismiss3") is None
-
-
-# [...]
-# 2. Handle any user prompts and return its value if it is an error.
-# [...]
-# In order to handle any user prompts a remote end must take the following
-# steps:
-# 2. Run the substeps of the first matching user prompt handler:
-#
-#    [...]
-#    - accept state
-#      1. Accept the current user prompt.
-#    [...]
-#
-# 3. Return success.
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<body><p>Hello, World!</p></body>")
-    create_dialog(session)("alert", text="accept #1", result_var="accept1")
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-    assert_dialog_handled(session, "accept #1")
-    assert read_global(session, "accept1") is None
-
-    create_dialog(session)("confirm", text="accept #2", result_var="accept2")
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-    assert_dialog_handled(session, "accept #2")
-    assert read_global(session, "accept2") is True
-
-    create_dialog(session)("prompt", text="accept #3", result_var="accept3")
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-    assert_dialog_handled(session, "accept #3")
-    assert read_global(session, "accept3") == "" or read_global(session, "accept3") == "undefined"
-
-
-# [...]
-# 2. Handle any user prompts and return its value if it is an error.
-# [...]
-# In order to handle any user prompts a remote end must take the following
-# steps:
-# 2. Run the substeps of the first matching user prompt handler:
-#
-#    [...]
-#    - missing value default state
-#    - not in the table of simple dialogs
-#      1. Dismiss the current user prompt.
-#      2. Return error with error code unexpected alert open.
-def test_handle_prompt_missing_value(session, create_dialog):
-    session.url = inline("<body><p>Hello, World!</p></body>")
-
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = get_active_element(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-    assert session.execute_script("return dismiss1") is None
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = get_active_element(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-    assert session.execute_script("return dismiss2") is False
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = get_active_element(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-    assert session.execute_script("return dismiss3") is None
-
-
-# > [...]
-# > 3. Let active element be the active element of the current browsing
-# >    context's document element.
-# > 4. Let active web element be the JSON Serialization of active element.
-# > 5. Return success with data active web element.
-def test_success_document(session):
-    session.url = inline("""
-        <body>
-            <h1>Heading</h1>
-            <input />
-            <input />
-            <input style="opacity: 0" />
-            <p>Another element</p>
-        </body>""")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-
-def test_sucess_input(session):
-    session.url = inline("""
-        <body>
-            <h1>Heading</h1>
-            <input autofocus />
-            <input style="opacity: 0" />
-            <p>Another element</p>
-        </body>""")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-
-def test_sucess_input_non_interactable(session):
-    session.url = inline("""
-        <body>
-            <h1>Heading</h1>
-            <input />
-            <input style="opacity: 0" autofocus />
-            <p>Another element</p>
-        </body>""")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-
-def test_success_explicit_focus(session):
-    session.url = inline("""
-        <body>
-            <h1>Heading</h1>
-            <input />
-            <iframe></iframe>
-        </body>""")
-
-    session.execute_script("document.body.getElementsByTagName('h1')[0].focus()")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-    session.execute_script("document.body.getElementsByTagName('input')[0].focus()")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-    session.execute_script("document.body.getElementsByTagName('iframe')[0].focus()")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-    session.execute_script("document.body.getElementsByTagName('iframe')[0].focus();")
-    session.execute_script("""
-        var iframe = document.body.getElementsByTagName('iframe')[0];
-        if (iframe.remove) {
-          iframe.remove();
-        } else {
-          iframe.removeNode(true);
-        }""")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-    session.execute_script("document.body.appendChild(document.createElement('textarea'))")
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-
-def test_success_iframe_content(session):
-    session.url = inline("<body></body>")
-    session.execute_script("""
-        let iframe = document.createElement('iframe');
-        document.body.appendChild(iframe);
-        let input = iframe.contentDocument.createElement('input');
-        iframe.contentDocument.body.appendChild(input);
-        input.focus();
-        """)
-
-    response = get_active_element(session)
-    assert_is_active_element(session, response)
-
-
-def test_missing_document_element(session):
-    session.url = inline("<body></body>")
-    session.execute_script("""
-        if (document.body.remove) {
-          document.body.remove();
-        } else {
-          document.body.removeNode(true);
-        }""")
-
-    response = get_active_element(session)
-    assert_error(response, "no such element")
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/fullscreen_window.py b/WebDriverTests/imported/w3c/webdriver/tests/fullscreen_window.py
deleted file mode 100644 (file)
index 36dd78f..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-# META: timeout=long
-
-from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-alert_doc = inline("<script>window.alert()</script>")
-
-
-def read_global(session, name):
-    return session.execute_script("return %s;" % name)
-
-
-def fullscreen(session):
-    return session.transport.send("POST", "session/%s/window/fullscreen" % session.session_id)
-
-
-def is_fullscreen(session):
-    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
-    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
-    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
-
-
-# 10.7.5 Fullscreen Window
-
-
-def test_no_browsing_context(session, create_window):
-    """
-    1. If the current top-level browsing context is no longer open,
-    return error with error code no such window.
-
-    """
-    session.window_handle = create_window()
-    session.close()
-    response = fullscreen(session)
-    assert_error(response, "no such window")
-
-
-def test_handle_prompt_dismiss_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_ignore():
-    """TODO"""
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - accept state
-           Accept the current user prompt.
-
-    """
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog(session)("alert", text="accept #1", result_var="accept1")
-
-    response = fullscreen(session)
-
-    assert_dialog_handled(session, "accept #1")
-    assert read_global(session, "accept1") == None
-
-    expected_title = read_global(session, "document.title")
-    create_dialog(session)("confirm", text="accept #2", result_var="accept2")
-
-    response = fullscreen(session)
-
-    assert_dialog_handled(session, "accept #2")
-    assert read_global(session, "accept2"), True
-
-    create_dialog(session)("prompt", text="accept #3", result_var="accept3")
-
-    response = fullscreen(session)
-
-    assert_dialog_handled(session, "accept #3")
-    assert read_global(session, "accept3") == "" or read_global(session, "accept3") == "undefined"
-
-
-def test_handle_prompt_missing_value(session, create_dialog):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - missing value default state
-           1. Dismiss the current user prompt.
-           2. Return error with error code unexpected alert open.
-
-    """
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = fullscreen(session)
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-    assert read_global(session, "dismiss1") == None
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = fullscreen(session)
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-    assert read_global(session, "dismiss2") == False
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = fullscreen(session)
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-    assert read_global(session, "dismiss3") == None
-
-
-def test_fullscreen(session):
-    """
-    4. Call fullscreen an element with the current top-level browsing
-    context's active document's document element.
-
-    """
-    response = fullscreen(session)
-    assert_success(response)
-
-    assert is_fullscreen(session) is True
-
-
-def test_payload(session):
-    """
-    5. Return success with the JSON serialization of the current top-level
-    browsing context's window rect.
-
-    [...]
-
-    A top-level browsing context's window rect is defined as a
-    dictionary of the screenX, screenY, width and height attributes of
-    the WindowProxy. Its JSON representation is the following:
-
-    "x"
-        WindowProxy's screenX attribute.
-
-    "y"
-        WindowProxy's screenY attribute.
-
-    "width"
-        Width of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    "height"
-        Height of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    """
-    response = fullscreen(session)
-
-    # step 5
-    assert response.status == 200
-    assert isinstance(response.body["value"], dict)
-
-    value = response.body["value"]
-    assert "width" in value
-    assert "height" in value
-    assert "x" in value
-    assert "y" in value
-    assert isinstance(value["width"], int)
-    assert isinstance(value["height"], int)
-    assert isinstance(value["x"], int)
-    assert isinstance(value["y"], int)
-
-
-def test_fullscreen_twice_is_idempotent(session):
-    assert is_fullscreen(session) is False
-
-    first_response = fullscreen(session)
-    assert_success(first_response)
-    assert is_fullscreen(session) is True
-
-    second_response = fullscreen(session)
-    assert_success(second_response)
-    assert is_fullscreen(session) is True
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/get_window_rect.py b/WebDriverTests/imported/w3c/webdriver/tests/get_window_rect.py
deleted file mode 100644 (file)
index cb3398e..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-alert_doc = inline("<script>window.alert()</script>")
-
-
-def get_window_rect(session):
-    return session.transport.send("GET", "session/%s/window/rect" % session.session_id)
-
-
-# 10.7.1 Get Window Rect
-
-
-def test_no_browsing_context(session, create_window):
-    """
-    1. If the current top-level browsing context is no longer open,
-    return error with error code no such window.
-
-    """
-    session.window_handle = create_window()
-    session.close()
-    response = get_window_rect(session)
-    assert_error(response, "no such window")
-
-
-def test_handle_prompt_dismiss_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_ignore():
-    """TODO"""
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - accept state
-           Accept the current user prompt.
-
-    """
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<title>WD doc title</title>")
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-    response = get_window_rect(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-    response = get_window_rect(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-    response = get_window_rect(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session, create_dialog):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - missing value default state
-           1. Dismiss the current user prompt.
-           2. Return error with error code unexpected alert open.
-
-    """
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = get_window_rect(session)
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = get_window_rect(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = get_window_rect(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_payload(session):
-    """
-    3. Return success with the JSON serialization of the current top-level
-    browsing context's window rect.
-
-    [...]
-
-    A top-level browsing context's window rect is defined as a
-    dictionary of the screenX, screenY, width and height attributes of
-    the WindowProxy. Its JSON representation is the following:
-
-    "x"
-        WindowProxy's screenX attribute.
-
-    "y"
-        WindowProxy's screenY attribute.
-
-    "width"
-        Width of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    "height"
-        Height of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    """
-    response = get_window_rect(session)
-
-    assert response.status == 200
-    assert isinstance(response.body["value"], dict)
-    value = response.body["value"]
-    expected = session.execute_script("""return {
-         x: window.screenX,
-         y: window.screenY,
-         width: window.outerWidth,
-         height: window.outerHeight
-    }""")
-    assert expected == value
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/interaction/element_clear.py b/WebDriverTests/imported/w3c/webdriver/tests/interaction/element_clear.py
deleted file mode 100644 (file)
index ceec0e2..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-# META: timeout=long
-
-import pytest
-
-from tests.support.asserts import (
-    assert_element_has_focus,
-    assert_error,
-    assert_success,
-)
-from tests.support.inline import inline
-
-def add_event_listeners(element):
-    element.session.execute_script("""
-        var target = arguments[0];
-        window.events = [];
-        var expectedEvents = ["focus", "blur", "change"];
-        for (var i = 0; i < expectedEvents.length; i++) {
-          target.addEventListener(expectedEvents[i], function (eventObject) { window.events.push(eventObject.type) });
-        }
-        """, args=(element,))
-
-
-def get_events(session):
-    return session.execute_script("return window.events")
-
-
-@pytest.fixture(scope="session")
-def text_file(tmpdir_factory):
-    fh = tmpdir_factory.mktemp("tmp").join("hello.txt")
-    fh.write("hello")
-    return fh
-
-
-def element_clear(session, element):
-    return session.transport.send("POST", "/session/%s/element/%s/clear" %
-                                  (session.session_id, element.id))
-
-
-def test_closed_context(session, create_window):
-    new_window = create_window()
-    session.window_handle = new_window
-    session.url = inline("<input>")
-    element = session.find.css("input", all=False)
-    session.close()
-
-    response = element_clear(session, element)
-    assert_error(response, "no such window")
-
-
-def test_connected_element(session):
-    session.url = inline("<input>")
-    element = session.find.css("input", all=False)
-
-    session.url = inline("<input>")
-    response = element_clear(session, element)
-    assert_error(response, "stale element reference")
-
-
-def test_pointer_interactable(session):
-    session.url = inline("<input style='margin-left: -1000px' value=foobar>")
-    element = session.find.css("input", all=False)
-
-    response = element_clear(session, element)
-    assert_error(response, "element not interactable")
-
-
-def test_keyboard_interactable(session):
-    session.url = inline("""
-        <input value=foobar>
-        <div></div>
-
-        <style>
-        div {
-          position: absolute;
-          background: blue;
-          top: 0;
-        }
-        </style>
-        """)
-    element = session.find.css("input", all=False)
-    assert element.property("value") == "foobar"
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == ""
-
-
-@pytest.mark.parametrize("type,value,default",
-                         [("number", "42", ""),
-                          ("range", "42", "50"),
-                          ("email", "foo@example.com", ""),
-                          ("password", "password", ""),
-                          ("search", "search", ""),
-                          ("tel", "999", ""),
-                          ("text", "text", ""),
-                          ("url", "https://example.com/", ""),
-                          ("color", "#ff0000", "#000000"),
-                          ("date", "2017-12-26", ""),
-                          ("datetime", "2017-12-26T19:48", ""),
-                          ("datetime-local", "2017-12-26T19:48", ""),
-                          ("time", "19:48", ""),
-                          ("month", "2017-11", ""),
-                          ("week", "2017-W52", "")])
-def test_input(session, type, value, default):
-    session.url = inline("<input type=%s value='%s'>" % (type, value))
-    element = session.find.css("input", all=False)
-    add_event_listeners(element)
-    assert element.property("value") == value
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == default
-    events = get_events(session)
-    assert "focus" in events
-    assert "change" in events
-    assert "blur" in events
-    assert_element_has_focus(session.execute_script("return document.body"))
-
-
-@pytest.mark.parametrize("type",
-                         ["number",
-                          "range",
-                          "email",
-                          "password",
-                          "search",
-                          "tel",
-                          "text",
-                          "url",
-                          "color",
-                          "date",
-                          "datetime",
-                          "datetime-local",
-                          "time",
-                          "month",
-                          "week",
-                          "file"])
-def test_input_disabled(session, type):
-    session.url = inline("<input type=%s disabled>" % type)
-    element = session.find.css("input", all=False)
-
-    response = element_clear(session, element)
-    assert_error(response, "invalid element state")
-
-
-@pytest.mark.parametrize("type",
-                         ["number",
-                          "range",
-                          "email",
-                          "password",
-                          "search",
-                          "tel",
-                          "text",
-                          "url",
-                          "color",
-                          "date",
-                          "datetime",
-                          "datetime-local",
-                          "time",
-                          "month",
-                          "week",
-                          "file"])
-def test_input_readonly(session, type):
-    session.url = inline("<input type=%s readonly>" % type)
-    element = session.find.css("input", all=False)
-
-    response = element_clear(session, element)
-    assert_error(response, "invalid element state")
-
-
-def test_textarea(session):
-    session.url = inline("<textarea>foobar</textarea>")
-    element = session.find.css("textarea", all=False)
-    add_event_listeners(element)
-    assert element.property("value") == "foobar"
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == ""
-    events = get_events(session)
-    assert "focus" in events
-    assert "change" in events
-    assert "blur" in events
-
-
-def test_textarea_disabled(session):
-    session.url = inline("<textarea disabled></textarea>")
-    element = session.find.css("textarea", all=False)
-
-    response = element_clear(session, element)
-    assert_error(response, "invalid element state")
-
-
-def test_textarea_readonly(session):
-    session.url = inline("<textarea readonly></textarea>")
-    element = session.find.css("textarea", all=False)
-
-    response = element_clear(session, element)
-    assert_error(response, "invalid element state")
-
-
-def test_input_file(session, text_file):
-    session.url = inline("<input type=file>")
-    element = session.find.css("input", all=False)
-    element.send_keys(str(text_file))
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == ""
-
-
-def test_input_file_multiple(session, text_file):
-    session.url = inline("<input type=file multiple>")
-    element = session.find.css("input", all=False)
-    element.send_keys(str(text_file))
-    element.send_keys(str(text_file))
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == ""
-
-
-def test_select(session):
-    session.url = inline("""
-        <select>
-          <option>foo
-        </select>
-        """)
-    select = session.find.css("select", all=False)
-    option = session.find.css("option", all=False)
-
-    response = element_clear(session, select)
-    assert_error(response, "invalid element state")
-    response = element_clear(session, option)
-    assert_error(response, "invalid element state")
-
-
-def test_button(session):
-    session.url = inline("<button></button>")
-    button = session.find.css("button", all=False)
-
-    response = element_clear(session, button)
-    assert_error(response, "invalid element state")
-
-
-def test_button_with_subtree(session):
-    """
-    Whilst an <input> is normally editable, the focusable area
-    where it is placed will default to the <button>.  I.e. if you
-    try to click <input> to focus it, you will hit the <button>.
-    """
-    session.url = inline("""
-        <button>
-          <input value=foobar>
-        </button>
-        """)
-    text_field = session.find.css("input", all=False)
-
-    response = element_clear(session, text_field)
-    assert_error(response, "element not interactable")
-
-
-def test_contenteditable(session):
-    session.url = inline("<p contenteditable>foobar</p>")
-    element = session.find.css("p", all=False)
-    add_event_listeners(element)
-    assert element.property("innerHTML") == "foobar"
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("innerHTML") == ""
-    assert get_events(session) == ["focus", "change", "blur"]
-    assert_element_has_focus(session.execute_script("return document.body"))
-
-
-def test_designmode(session):
-    session.url = inline("foobar")
-    element = session.find.css("body", all=False)
-    assert element.property("innerHTML") == "foobar"
-    session.execute_script("document.designMode = 'on'")
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("innerHTML") == "<br>"
-    assert_element_has_focus(session.execute_script("return document.body"))
-
-
-def test_resettable_element_focus_when_empty(session):
-    session.url = inline("<input>")
-    element = session.find.css("input", all=False)
-    add_event_listeners(element)
-    assert element.property("value") == ""
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == ""
-    assert get_events(session) == []
-
-
-@pytest.mark.parametrize("type,invalid_value",
-                         [("number", "foo"),
-                          ("range", "foo"),
-                          ("email", "foo"),
-                          ("url", "foo"),
-                          ("color", "foo"),
-                          ("date", "foo"),
-                          ("datetime", "foo"),
-                          ("datetime-local", "foo"),
-                          ("time", "foo"),
-                          ("month", "foo"),
-                          ("week", "foo")])
-def test_resettable_element_does_not_satisfy_validation_constraints(session, type, invalid_value):
-    """
-    Some UAs allow invalid input to certain types of constrained
-    form controls.  For example, Gecko allows non-valid characters
-    to be typed into <input type=number> but Chrome does not.
-    Since we want to test that Element Clear works for clearing the
-    invalid characters in these UAs, it is fine to skip this test
-    where UAs do not allow the element to not satisfy its constraints.
-    """
-    session.url = inline("<input type=%s>" % type)
-    element = session.find.css("input", all=False)
-
-    def is_valid(element):
-        return session.execute_script("""
-            var input = arguments[0];
-            return input.validity.valid;
-            """, args=(element,))
-
-    # value property does not get updated if the input is invalid
-    element.send_keys(invalid_value)
-
-    # UA does not allow invalid input for this form control type
-    if is_valid(element):
-        return
-
-    response = element_clear(session, element)
-    assert_success(response)
-    assert is_valid(element)
-
-
-@pytest.mark.parametrize("type",
-                         ["checkbox",
-                          "radio",
-                          "hidden",
-                          "submit",
-                          "button",
-                          "image"])
-def test_non_editable_inputs(session, type):
-    session.url = inline("<input type=%s>" % type)
-    element = session.find.css("input", all=False)
-
-    response = element_clear(session, element)
-    assert_error(response, "invalid element state")
-
-
-def test_scroll_into_view(session):
-    session.url = inline("""
-        <input value=foobar>
-        <div style='height: 200vh; width: 5000vh'>
-        """)
-    element = session.find.css("input", all=False)
-    assert element.property("value") == "foobar"
-    assert session.execute_script("return window.pageYOffset") == 0
-
-    # scroll to the bottom right of the page
-    session.execute_script("""
-        var body = document.body;
-        window.scrollTo(body.scrollWidth, body.scrollHeight);
-        """)
-
-    # clear and scroll back to the top of the page
-    response = element_clear(session, element)
-    assert_success(response)
-    assert element.property("value") == ""
-
-    # check if element cleared is scrolled into view
-    rect = session.execute_script("""
-        var input = arguments[0];
-        var rect = input.getBoundingClientRect();
-        return {"top": rect.top,
-                "left": rect.left,
-                "height": rect.height,
-                "width": rect.width};
-        """, args=(element,))
-    window = session.execute_script("""
-        return {"innerHeight": window.innerHeight,
-                "innerWidth": window.innerWidth,
-                "pageXOffset": window.pageXOffset,
-                "pageYOffset": window.pageYOffset};
-        """)
-
-    assert rect["top"] < (window["innerHeight"] + window["pageYOffset"]) and \
-           rect["left"] < (window["innerWidth"] + window["pageXOffset"]) and \
-           (rect["top"] + element.rect["height"]) > window["pageYOffset"] and \
-           (rect["left"] + element.rect["width"]) > window["pageXOffset"]
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/interaction/send_keys_content_editable.py b/WebDriverTests/imported/w3c/webdriver/tests/interaction/send_keys_content_editable.py
deleted file mode 100644 (file)
index 16ebc2d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-import pytest
-
-from tests.support.inline import inline
-
-
-def test_sets_insertion_point_to_end(session):
-    session.url = inline('<div contenteditable=true>Hello,</div>')
-    input = session.find.css("div", all=False)
-    input.send_keys(' world!')
-    text = session.execute_script('return arguments[0].innerText', args=[input])
-    assert "Hello, world!" == text.strip()
-
-
-# 12. Let current text length be the element's length.
-#
-# 13. Set the text insertion caret using set selection range using current
-#     text length for both the start and end parameters.
-def test_sets_insertion_point_to_after_last_text_node(session):
-    session.url = inline('<div contenteditable=true>Hel<span>lo</span>,</div>')
-    input = session.find.css("div", all=False)
-    input.send_keys(" world!")
-    text = session.execute_script("return arguments[0].innerText", args=[input])
-    assert "Hello, world!" == text.strip()
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/minimize_window.py b/WebDriverTests/imported/w3c/webdriver/tests/minimize_window.py
deleted file mode 100644 (file)
index ff451de..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-alert_doc = inline("<script>window.alert()</script>")
-
-
-def minimize(session):
-    return session.transport.send("POST", "session/%s/window/minimize" % session.session_id)
-
-
-def is_fullscreen(session):
-    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
-    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
-    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
-
-# 10.7.4 Minimize Window
-
-
-def test_no_browsing_context(session, create_window):
-    """
-    1. If the current top-level browsing context is no longer open,
-    return error with error code no such window.
-
-    """
-    session.window_handle = create_window()
-    session.close()
-    response = minimize(session)
-    assert_error(response, "no such window")
-
-
-def test_handle_prompt_dismiss_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_ignore():
-    """TODO"""
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - accept state
-           Accept the current user prompt.
-
-    """
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<title>WD doc title</title>")
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-    response = minimize(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-    response = minimize(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-    response = minimize(session)
-    assert response.status == 200
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session, create_dialog):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - missing value default state
-           1. Dismiss the current user prompt.
-           2. Return error with error code unexpected alert open.
-
-    """
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    response = minimize(session)
-
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    response = minimize(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    response = minimize(session)
-    assert_error(response, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_fully_exit_fullscreen(session):
-    """
-    4. Fully exit fullscreen.
-
-    [...]
-
-    To fully exit fullscreen a document document, run these steps:
-
-      1. If document's fullscreen element is null, terminate these steps.
-
-      2. Unfullscreen elements whose fullscreen flag is set, within
-      document's top layer, except for document's fullscreen element.
-
-      3. Exit fullscreen document.
-
-    """
-    session.window.fullscreen()
-    assert is_fullscreen(session) is True
-
-    response = minimize(session)
-    assert_success(response)
-    assert is_fullscreen(session) is False
-    assert session.execute_script("return document.hidden") is True
-
-
-def test_minimize(session):
-    """
-    5. Iconify the window.
-
-    [...]
-
-    To iconify the window, given an operating system level window with an
-    associated top-level browsing context, run implementation-specific
-    steps to iconify, minimize, or hide the window from the visible
-    screen. Do not return from this operation until the visibility state
-    of the top-level browsing context's active document has reached the
-    hidden state, or until the operation times out.
-
-    """
-    assert not session.execute_script("return document.hidden")
-
-    response = minimize(session)
-    assert_success(response)
-
-    assert session.execute_script("return document.hidden")
-
-
-def test_payload(session):
-    """
-    6. Return success with the JSON serialization of the current top-level
-    browsing context's window rect.
-
-    [...]
-
-    A top-level browsing context's window rect is defined as a
-    dictionary of the screenX, screenY, width and height attributes of
-    the WindowProxy. Its JSON representation is the following:
-
-    "x"
-        WindowProxy's screenX attribute.
-
-    "y"
-        WindowProxy's screenY attribute.
-
-    "width"
-        Width of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    "height"
-        Height of the top-level browsing context's outer dimensions,
-        including any browser chrome and externally drawn window
-        decorations in CSS reference pixels.
-
-    """
-    assert not session.execute_script("return document.hidden")
-
-    response = minimize(session)
-
-    assert response.status == 200
-    assert isinstance(response.body["value"], dict)
-
-    value = response.body["value"]
-    assert "width" in value
-    assert "height" in value
-    assert "x" in value
-    assert "y" in value
-    assert isinstance(value["width"], int)
-    assert isinstance(value["height"], int)
-    assert isinstance(value["x"], int)
-    assert isinstance(value["y"], int)
-
-    assert session.execute_script("return document.hidden")
-
-
-def test_minimize_twice_is_idempotent(session):
-    assert not session.execute_script("return document.hidden")
-
-    first_response = minimize(session)
-    assert_success(first_response)
-    assert session.execute_script("return document.hidden")
-
-    second_response = minimize(session)
-    assert_success(second_response)
-    assert session.execute_script("return document.hidden")
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/navigation/current_url.py b/WebDriverTests/imported/w3c/webdriver/tests/navigation/current_url.py
deleted file mode 100644 (file)
index b3dfe1f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-import json
-import pytest
-import types
-
-from tests.support.inline import inline
-from tests.support.asserts import assert_error, assert_success
-from tests.support.wait import wait
-
-alert_doc = inline("<script>window.alert()</script>")
-frame_doc = inline("<p>frame")
-one_frame_doc = inline("<iframe src='%s'></iframe>" % frame_doc)
-two_frames_doc = inline("<iframe src='%s'></iframe>" % one_frame_doc)
-
-
-# TODO(ato): 7.1 Get
-
-
-def test_get_current_url_no_browsing_context(session, create_window):
-    # 7.2 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert_error(result, "no such window")
-
-
-def test_get_current_url_alert_prompt(session):
-    # 7.2 step 2
-    session.url = alert_doc
-
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert_error(result, "unexpected alert open")
-
-def test_get_current_url_matches_location(session):
-    # 7.2 step 3
-    url = session.execute_script("return window.location.href")
-    assert session.url == url
-
-def test_get_current_url_payload(session):
-    # 7.2 step 4-5
-    session.start()
-
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert result.status == 200
-    assert isinstance(result.body["value"], basestring)
-
-def test_get_current_url_special_pages(session):
-    session.url = "about:blank"
-
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert_success(result, "about:blank")
-
-# TODO(ato): This test requires modification to pass on Windows
-def test_get_current_url_file_protocol(session):
-    # tests that the browsing context remains the same
-    # when navigated privileged documents
-    session.url = "file:///"
-
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert_success(result, "file:///")
-
-# TODO(ato): Test for http:// and https:// protocols.
-# We need to expose a fixture for accessing
-# documents served by wptserve in order to test this.
-
-def test_set_malformed_url(session):
-    result = session.transport.send("POST",
-                                    "session/%s/url" % session.session_id,
-                                    {"url": "foo"})
-
-    assert_error(result, "invalid argument")
-
-def test_get_current_url_after_modified_location(session):
-    start = session.transport.send("GET", "session/%s/url" % session.session_id)
-    session.execute_script("window.location.href = 'about:blank#wd_test_modification'")
-    wait(session,
-         lambda s: s.transport.send("GET", "session/%s/url" % session.session_id) != start.body["value"],
-         "URL did not change")
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert_success(result, "about:blank#wd_test_modification")
-
-def test_get_current_url_nested_browsing_context(session, create_frame):
-    session.url = "about:blank#wd_from_within_frame"
-    session.switch_frame(create_frame())
-
-    result = session.transport.send("GET", "session/%s/url" % session.session_id)
-
-    assert_success(result, "about:blank#wd_from_within_frame")
-
-def test_get_current_url_nested_browsing_contexts(session):
-    session.url = two_frames_doc
-    top_level_url = session.url
-
-    outer_frame = session.find.css("iframe", all=False)
-    session.switch_frame(outer_frame)
-
-    inner_frame = session.find.css("iframe", all=False)
-    session.switch_frame(inner_frame)
-
-    assert session.url == top_level_url
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/navigation/get_title.py b/WebDriverTests/imported/w3c/webdriver/tests/navigation/get_title.py
deleted file mode 100644 (file)
index 3edee84..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-import pytest
-import time
-
-from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-def read_global(session, name):
-    return session.execute_script("return %s;" % name)
-
-# 1. If the current top-level browsing context is no longer open, return error
-#    with error code no such window.
-def test_title_from_closed_context(session, create_window):
-    new_window = create_window()
-    session.window_handle = new_window
-    session.close()
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_error(result, "no such window")
-
-# [...]
-# 2. Handle any user prompts and return its value if it is an error.
-# [...]
-# In order to handle any user prompts a remote end must take the following
-# steps:
-# 2. Run the substeps of the first matching user prompt handler:
-#
-#    [...]
-#    - dismiss state
-#      1. Dismiss the current user prompt.
-#    [...]
-#
-# 3. Return success.
-def test_title_handle_prompt_dismiss(new_session, add_browser_capabilites):
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "dismiss"})}})
-    session.url = inline("<title>WD doc title</title>")
-
-    expected_title = read_global(session, "document.title")
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, expected_title)
-    assert_dialog_handled(session, "dismiss #1")
-    assert read_global(session, "dismiss1") == None
-
-    expected_title = read_global(session, "document.title")
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, expected_title)
-    assert_dialog_handled(session, "dismiss #2")
-    assert read_global(session, "dismiss2") == False
-
-    expected_title = read_global(session, "document.title")
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, expected_title)
-    assert_dialog_handled(session, "dismiss #3")
-    assert read_global(session, "dismiss3") == None
-
-# [...]
-# 2. Handle any user prompts and return its value if it is an error.
-# [...]
-# In order to handle any user prompts a remote end must take the following
-# steps:
-# 2. Run the substeps of the first matching user prompt handler:
-#
-#    [...]
-#    - accept state
-#      1. Accept the current user prompt.
-#    [...]
-#
-# 3. Return success.
-def test_title_handle_prompt_accept(new_session, add_browser_capabilites):
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog(session)("alert", text="accept #1", result_var="accept1")
-
-    expected_title = read_global(session, "document.title")
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, expected_title)
-    assert_dialog_handled(session, "accept #1")
-    assert read_global(session, "accept1") == None
-
-    expected_title = read_global(session, "document.title")
-    create_dialog(session)("confirm", text="accept #2", result_var="accept2")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, expected_title)
-    assert_dialog_handled(session, "accept #2")
-    assert read_global(session, "accept2") == True
-
-    expected_title = read_global(session, "document.title")
-    create_dialog(session)("prompt", text="accept #3", result_var="accept3")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, expected_title)
-    assert_dialog_handled(session, "accept #3")
-    assert read_global(session, "accept3") == "" or read_global(session, "accept3") == "undefined"
-
-# [...]
-# 2. Handle any user prompts and return its value if it is an error.
-# [...]
-# In order to handle any user prompts a remote end must take the following
-# steps:
-# 2. Run the substeps of the first matching user prompt handler:
-#
-#    [...]
-#    - missing value default state
-#    - not in the table of simple dialogs
-#      1. Dismiss the current user prompt.
-#      2. Return error with error code unexpected alert open.
-def test_title_handle_prompt_missing_value(session, create_dialog):
-    session.url = inline("<title>WD doc title</title>")
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-    assert read_global(session, "dismiss1") == None
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-    assert read_global(session, "dismiss2") == False
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-    assert read_global(session, "dismiss3") == None
-
-# The behavior of the `window.print` function is platform-dependent and may not
-# trigger the creation of a dialog at all. Therefore, this test should only be
-# run in contexts that support the dialog (a condition that may not be
-# determined automatically).
-#def test_title_with_non_simple_dialog(session):
-#    document = "<title>With non-simple dialog</title><h2>Hello</h2>"
-#    spawn = """
-#        var done = arguments[0];
-#        setTimeout(function() {
-#            done();
-#        }, 0);
-#        setTimeout(function() {
-#            window['print']();
-#        }, 0);
-#    """
-#    session.url = inline(document)
-#    session.execute_async_script(spawn)
-#
-#    result = session.transport.send("GET",
-#                                    "session/%s/title" % session.session_id)
-#    assert_error(result, "unexpected alert open")
-
-# [...]
-# 3. Let title be the initial value of the title IDL attribute of the current
-#    top-level browsing context's active document.
-# 4. Return success with data title.
-# [...]
-# The title attribute must, on getting, run the following algorithm:
-# [...]
-# 2. Otherwise, let value be the child text content of the title element [...]
-# [...]
-# 4. Return value.
-def test_title_from_top_context(session):
-    session.url = inline("<title>Foobar</title><h2>Hello</h2>")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-    assert_success(result, read_global(session, "document.title"))
-
-# [...]
-# 3. Let title be the initial value of the title IDL attribute of the current
-#    top-level browsing context's active document.
-# 4. Return success with data title.
-# [...]
-# The title attribute must, on getting, run the following algorithm:
-# [...]
-# 2. Otherwise, let value be the child text content of the title element [...]
-#
-#    The title element of a document is the first title element in the document
-#    (in tree order), if there is one, or null otherwise.
-#
-# [...]
-# 4. Return value.
-def test_title_with_duplicate_element(session):
-    session.url = inline("<title>First</title><title>Second</title>")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, read_global(session, "document.title"))
-
-# [...]
-# 3. Let title be the initial value of the title IDL attribute of the current
-#    top-level browsing context's active document.
-# 4. Return success with data title.
-# [...]
-# The title attribute must, on getting, run the following algorithm:
-# [...]
-# 2. Otherwise, let value be the child text content of the title element, or
-#    the empty string if the title element is null.
-# [...]
-# 4. Return value.
-def test_title_without_element(session):
-    session.url = inline("<h2>Hello</h2>")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, read_global(session, "document.title"))
-
-# [...]
-# 3. Let title be the initial value of the title IDL attribute of the current
-#    top-level browsing context's active document.
-# 4. Return success with data title.
-def test_title_after_modification(session):
-    session.url = inline("<title>Initial</title><h2>Hello</h2>")
-    session.execute_script("document.title = 'updated'")
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, read_global(session, "document.title"))
-
-# [...]
-# 3. Let title be the initial value of the title IDL attribute of the current
-#    top-level browsing context's active document.
-# 4. Return success with data title.
-# [...]
-# The title attribute must, on getting, run the following algorithm:
-# [...]
-# 2. Otherwise, let value be the child text content of the title element [...]
-# 3. Strip and collapse ASCII whitespace in value.
-# 4. Return value.
-def test_title_strip_and_collapse(session):
-    document = "<title>   a b\tc\nd\t \n e\t\n </title><h2>Hello</h2>"
-    session.url = inline(document)
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, read_global(session, "document.title"))
-
-# [...]
-# 3. Let title be the initial value of the title IDL attribute of the current
-#    top-level browsing context's active document.
-# 4. Return success with data title.
-def test_title_from_frame(session, create_frame):
-    session.url = inline("<title>Parent</title>parent")
-
-    session.switch_frame(create_frame())
-    session.switch_frame(create_frame())
-
-    result = session.transport.send("GET",
-                                    "session/%s/title" % session.session_id)
-
-    assert_success(result, "Parent")
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/get_timeouts.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/get_timeouts.py
deleted file mode 100644 (file)
index 96767e9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-from tests.support.asserts import assert_success
-
-
-def get_timeouts(session):
-    return session.transport.send("GET", "session/{session_id}/timeouts"
-                                  .format(session_id=session.session_id))
-
-
-# 8.4 Get Timeouts
-
-def test_get_timeouts(session):
-    # 8.4 step 1
-    response = get_timeouts(session)
-
-    assert_success(response)
-    assert "value" in response.body
-    assert isinstance(response.body["value"], dict)
-
-    value = response.body["value"]
-    assert "script" in value
-    assert "implicit" in value
-    assert "pageLoad" in value
-
-    assert isinstance(value["script"], int)
-    assert isinstance(value["implicit"], int)
-    assert isinstance(value["pageLoad"], int)
-
-
-def test_get_default_timeouts(session):
-    response = get_timeouts(session)
-
-    assert_success(response)
-    assert response.body["value"]["script"] == 30000
-    assert response.body["value"]["implicit"] == 0
-    assert response.body["value"]["pageLoad"] == 300000
-
-
-def test_get_new_timeouts(session):
-    session.timeouts.script = 60
-    session.timeouts.implicit = 1
-    session.timeouts.page_load = 200
-    response = get_timeouts(session)
-    assert_success(response)
-    assert response.body["value"]["script"] == 60000
-    assert response.body["value"]["implicit"] == 1000
-    assert response.body["value"]["pageLoad"] == 200000
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/conftest.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/conftest.py
deleted file mode 100644 (file)
index d3ee199..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-import pytest
-import sys
-
-import webdriver
-
-
-def product(a, b):
-    return [(a, item) for item in b]
-
-
-def flatten(l):
-    return [item for x in l for item in x]
-
-@pytest.fixture(scope="session")
-def platform_name():
-    return {
-        "linux2": "linux",
-        "win32": "windows",
-        "cygwin": "windows",
-        "darwin": "mac"
-    }.get(sys.platform)
-
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/create_alwaysMatch.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/create_alwaysMatch.py
deleted file mode 100644 (file)
index 2335048..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#META: timeout=long
-
-import pytest
-
-from conftest import product, flatten
-
-from support.create import valid_data
-
-
-@pytest.mark.parametrize("key,value", flatten(product(*item) for item in valid_data))
-def test_valid(new_session, add_browser_capabilites, key, value):
-    resp = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({key: value})}})
-
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/create_firstMatch.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/create_firstMatch.py
deleted file mode 100644 (file)
index 58203e5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#META: timeout=long
-
-import pytest
-
-from conftest import product, flatten
-
-from support.create import valid_data
-
-
-@pytest.mark.parametrize("key,value", flatten(product(*item) for item in valid_data))
-def test_valid(new_session, add_browser_capabilites, key, value):
-    resp = new_session({"capabilities": {"firstMatch": [add_browser_capabilites({key: value})]}})
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/default_values.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/default_values.py
deleted file mode 100644 (file)
index 0dbc798..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# META: timeout=long
-
-import uuid
-
-import pytest
-
-from webdriver import error
-
-
-def test_basic(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-    assert set(resp.keys()) == {"sessionId", "capabilities"}
-
-
-def test_repeat_new_session(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-    with pytest.raises(error.SessionNotCreatedException):
-        new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-
-
-def test_no_capabilites(new_session):
-    with pytest.raises(error.InvalidArgumentException):
-        new_session({})
-
-
-def test_missing_first_match(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-
-
-def test_missing_always_match(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"firstMatch": [add_browser_capabilites({})]}})
-
-
-def test_desired(new_session, add_browser_capabilites):
-    with pytest.raises(error.InvalidArgumentException):
-        resp, _ = new_session({"desiredCapbilities": add_browser_capabilites({})})
-
-
-def test_ignore_non_spec_fields_in_capabilities(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({}), "desiredCapbilities": {"pageLoadStrategy": "eager"}}})
-    assert resp["capabilities"]["pageLoadStrategy"] == "normal"
-
-
-def test_valid_but_unmatchable_key(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {
-      "firstMatch": [add_browser_capabilites({"pageLoadStrategy": "eager", "foo:unmatchable": True}),
-                     {"pageLoadStrategy": "none"}]}})
-    assert resp["capabilities"]["pageLoadStrategy"] == "none"
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py
deleted file mode 100644 (file)
index 52f2582..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#META: timeout=long
-
-import pytest
-from webdriver import error
-
-from conftest import product, flatten
-
-
-@pytest.mark.parametrize("value", [None, 1, "{}", []])
-def test_invalid_capabilites(new_session, value):
-    with pytest.raises(error.InvalidArgumentException):
-        new_session({"capabilities": value})
-
-
-@pytest.mark.parametrize("value", [None, 1, "{}", []])
-def test_invalid_always_match(new_session, add_browser_capabilites, value):
-    with pytest.raises(error.InvalidArgumentException):
-        new_session({"capabilities": {"alwaysMatch": value, "firstMatch": [add_browser_capabilites({})]}})
-
-
-@pytest.mark.parametrize("value", [None, 1, "[]", {}])
-def test_invalid_first_match(new_session, add_browser_capabilites, value):
-    with pytest.raises(error.InvalidArgumentException):
-        new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({}), "firstMatch": value}})
-
-
-invalid_data = [
-    ("acceptInsecureCerts", [1, [], {}, "false"]),
-    ("browserName", [1, [], {}, False]),
-    ("browserVersion", [1, [], {}, False]),
-    ("platformName", [1, [], {}, False]),
-    ("pageLoadStrategy", [1, [], {}, False, "invalid", "NONE", "Eager", "eagerblah", "interactive",
-                          " eager", "eager "]),
-    ("proxy", [1, [], "{}", {"proxyType": "SYSTEM"}, {"proxyType": "systemSomething"},
-               {"proxy type": "pac"}, {"proxy-Type": "system"}, {"proxy_type": "system"},
-               {"proxytype": "system"}, {"PROXYTYPE": "system"}, {"proxyType": None},
-               {"proxyType": 1}, {"proxyType": []}, {"proxyType": {"value": "system"}},
-               {" proxyType": "system"}, {"proxyType ": "system"}, {"proxyType ": " system"},
-               {"proxyType": "system "}]),
-    ("timeouts", [1, [], "{}", False, {"pageLOAD": 10}, {"page load": 10},
-                  {"page load": 10}, {"pageLoad": "10"}, {"pageLoad": {"value": 10}},
-                  {"invalid": 10}, {"pageLoad": -1}, {"pageLoad": 2**64},
-                  {"pageLoad": None}, {"pageLoad": 1.1}, {"pageLoad": 10, "invalid": 10},
-                  {" pageLoad": 10}, {"pageLoad ": 10}]),
-    ("unhandledPromptBehavior", [1, [], {}, False, "DISMISS", "dismissABC", "Accept",
-                                 " dismiss", "dismiss "])
-]
-
-@pytest.mark.parametrize("body", [lambda key, value: {"alwaysMatch": {key: value}},
-                                  lambda key, value: {"firstMatch": [{key: value}]}])
-@pytest.mark.parametrize("key,value", flatten(product(*item) for item in invalid_data))
-def test_invalid_values(new_session, add_browser_capabilites, body, key, value):
-    capabilities = body(key, value)
-    if "alwaysMatch" in capabilities:
-        capabilities["alwaysMatch"] = add_browser_capabilites(capabilities["alwaysMatch"])
-    else:
-        capabilities["firstMatch"][0] = add_browser_capabilites(capabilities["firstMatch"][0])
-    with pytest.raises(error.InvalidArgumentException):
-        resp = new_session({"capabilities": capabilities})
-
-
-invalid_extensions = [
-    "firefox",
-    "firefox_binary",
-    "firefoxOptions",
-    "chromeOptions",
-    "automaticInspection",
-    "automaticProfiling",
-    "platform",
-    "version",
-    "browser",
-    "platformVersion",
-    "javascriptEnabled",
-    "nativeEvents",
-    "seleniumProtocol",
-    "profile",
-    "trustAllSSLCertificates",
-    "initialBrowserUrl",
-    "requireWindowFocus",
-    "logFile",
-    "logLevel",
-    "safari.options",
-    "ensureCleanSession",
-]
-
-
-@pytest.mark.parametrize("body", [lambda key, value: {"alwaysMatch": {key: value}},
-                                  lambda key, value: {"firstMatch": [{key: value}]}])
-@pytest.mark.parametrize("key", invalid_extensions)
-def test_invalid_extensions(new_session, add_browser_capabilites, body, key):
-    capabilities = body(key, {})
-    if "alwaysMatch" in capabilities:
-        capabilities["alwaysMatch"] = add_browser_capabilites(capabilities["alwaysMatch"])
-    else:
-        capabilities["firstMatch"][0] = add_browser_capabilites(capabilities["firstMatch"][0])
-    with pytest.raises(error.InvalidArgumentException):
-        resp = new_session({"capabilities": capabilities})
-
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/merge.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/merge.py
deleted file mode 100644 (file)
index 480fbcd..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#META: timeout=long
-
-import pytest
-from webdriver import error
-
-from conftest import platform_name
-
-
-@pytest.mark.skipif(platform_name() is None, reason="Unsupported platform")
-@pytest.mark.parametrize("body", [lambda key, value: {"alwaysMatch": {key: value}},
-                                  lambda key, value: {"firstMatch": [{key: value}]}])
-def test_platform_name(new_session, add_browser_capabilites, platform_name, body):
-    capabilities = body("platformName", platform_name)
-    if "alwaysMatch" in capabilities:
-        capabilities["alwaysMatch"] = add_browser_capabilites(capabilities["alwaysMatch"])
-    else:
-        capabilities["firstMatch"][0] = add_browser_capabilites(capabilities["firstMatch"][0])
-    resp, _ = new_session({"capabilities": capabilities})
-    assert resp["capabilities"]["platformName"] == platform_name
-
-
-invalid_merge = [
-    ("acceptInsecureCerts", (True, True)),
-    ("unhandledPromptBehavior", ("accept", "accept")),
-    ("unhandledPromptBehavior", ("accept", "dismiss")),
-    ("timeouts", ({"script": 10}, {"script": 10})),
-    ("timeouts", ({"script": 10}, {"pageLoad": 10})),
-]
-
-
-@pytest.mark.parametrize("key,value", invalid_merge)
-def test_merge_invalid(new_session, add_browser_capabilites, key, value):
-    with pytest.raises(error.InvalidArgumentException):
-         new_session({"capabilities":
-                      {"alwaysMatch": add_browser_capabilites({key: value[0]}),
-                       "firstMatch": [{}, {key: value[1]}]}})
-
-
-@pytest.mark.skipif(platform_name() is None, reason="Unsupported platform")
-def test_merge_platformName(new_session, add_browser_capabilites, platform_name):
-    resp, _ = new_session({"capabilities":
-                        {"alwaysMatch": add_browser_capabilites({"timeouts": {"script": 10}}),
-                        "firstMatch": [
-                            {
-                                "platformName": platform_name.upper(),
-                                "pageLoadStrategy": "none"
-                            },
-                            {
-                                "platformName": platform_name,
-                                "pageLoadStrategy": "eager"
-                            }
-                        ]}})
-
-    assert resp["capabilities"]["platformName"] == platform_name
-    assert resp["capabilities"]["pageLoadStrategy"] == "eager"
-
-
-def test_merge_browserName(new_session, add_browser_capabilites):
-    resp, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-    browser_settings = {
-        "browserName": resp["capabilities"]["browserName"],
-        "browserVersion": resp["capabilities"]["browserVersion"],
-        "platformName": resp["capabilities"]["platformName"]
-    }
-    session.end()
-
-    resp, _ = new_session({"capabilities":
-                        {"alwaysMatch": add_browser_capabilites({"timeouts": {"script": 10}}),
-                        "firstMatch": [
-                            {
-                                "browserName": browser_settings["browserName"] + "invalid",
-                                "pageLoadStrategy": "none"
-                            },
-                            {
-                                "browserName": browser_settings["browserName"],
-                                "pageLoadStrategy": "eager"
-                            }
-                        ]}})
-
-    assert resp["capabilities"]["browserName"] == browser_settings['browserName']
-    assert resp["capabilities"]["pageLoadStrategy"] == "eager"
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py
deleted file mode 100644 (file)
index c9a8c76..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# META: timeout=long
-
-import uuid
-
-def test_resp_sessionid(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-    assert isinstance(resp["sessionId"], unicode)
-    uuid.UUID(hex=resp["sessionId"])
-
-
-def test_resp_capabilites(new_session, add_browser_capabilites):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-    assert isinstance(resp["sessionId"], unicode)
-    assert isinstance(resp["capabilities"], dict)
-    assert {"browserName",
-            "browserVersion",
-            "platformName",
-            "acceptInsecureCerts",
-            "setWindowRect",
-            "timeouts",
-            "proxy",
-            "pageLoadStrategy"}.issubset(
-                set(resp["capabilities"].keys()))
-
-
-def test_resp_data(new_session, add_browser_capabilites, platform_name):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-
-    assert isinstance(resp["capabilities"]["browserName"], unicode)
-    assert isinstance(resp["capabilities"]["browserVersion"], unicode)
-    if platform_name:
-        assert resp["capabilities"]["platformName"] == platform_name
-    else:
-        assert "platformName" in resp["capabilities"]
-    assert resp["capabilities"]["acceptInsecureCerts"] is False
-    assert isinstance(resp["capabilities"]["setWindowRect"], bool)
-    assert resp["capabilities"]["timeouts"]["implicit"] == 0
-    assert resp["capabilities"]["timeouts"]["pageLoad"] == 300000
-    assert resp["capabilities"]["timeouts"]["script"] == 30000
-    assert resp["capabilities"]["proxy"] == {}
-    assert resp["capabilities"]["pageLoadStrategy"] == "normal"
-
-
-def test_timeouts(new_session, add_browser_capabilites, platform_name):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"timeouts": {"implicit": 1000}})}})
-    assert resp["capabilities"]["timeouts"] == {
-        "implicit": 1000,
-        "pageLoad": 300000,
-        "script": 30000
-    }
-
-def test_pageLoadStrategy(new_session, add_browser_capabilites, platform_name):
-    resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"pageLoadStrategy": "eager"})}})
-    assert resp["capabilities"]["pageLoadStrategy"] == "eager"
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/support/__init__.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/support/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/support/create.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/support/create.py
deleted file mode 100644 (file)
index 85ae1cd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# Note that we can only test things here all implementations must support
-valid_data = [
-    ("acceptInsecureCerts", [False, None]),
-    ("browserName", [None]),
-    ("browserVersion", [None]),
-    ("platformName", [None]),
-    ("pageLoadStrategy", ["none", "eager", "normal", None]),
-    ("proxy", [None]),
-    ("timeouts", [{"script": 0, "pageLoad": 2.0, "implicit": 2**53 - 1},
-                  {"script": 50, "pageLoad": 25},
-                  {"script": 500},
-                  {}]),
-    ("unhandledPromptBehavior", ["dismiss", "accept", None]),
-    ("test:extension", [True, "abc", 123, [], {"key": "value"}, None]),
-]
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/status.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/status.py
deleted file mode 100644 (file)
index 892ce92..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-import pytest
-import json
-
-
-def test_get_status_no_session(http):
-    with http.get("/status") as response:
-        # GET /status should never return an error
-        assert response.status == 200
-
-        # parse JSON response and unwrap 'value' property
-        parsed_obj = json.loads(response.read().decode('utf-8'))
-        value = parsed_obj["value"]
-
-        # Let body be a new JSON Object with the following properties:
-        # "ready"
-        #       The remote end's readiness state.
-        assert value["ready"] in [True, False]
-        # "message"
-        #       An implementation-defined string explaining the remote end's
-        #       readiness state.
-        assert isinstance(value["message"], basestring)
-
-
-def test_status_with_session_running_on_endpoint_node(new_session, add_browser_capabilites):
-    # For an endpoint node, the maximum number of active
-    # sessions is 1: https://www.w3.org/TR/webdriver/#dfn-maximum-active-sessions
-    # A session is open, so we expect `ready` to be False
-    # 8.3 step 1.
-
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
-    value = session.send_command("GET", "status")
-
-    assert value["ready"] == False
-    assert "message" in value
-
-    session.end()
-
-    # Active session count is 0, meaning that the
-    # readiness state of the server should be True
-    # 8.3 step 1. Again
-    value = session.send_command("GET", "status")
-
-    assert value["ready"] == True
-    assert "message" in value
-
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/set_window_rect.py b/WebDriverTests/imported/w3c/webdriver/tests/set_window_rect.py
deleted file mode 100644 (file)
index d032b9b..0000000
+++ /dev/null
@@ -1,510 +0,0 @@
-# META: timeout=long
-
-import pytest
-
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-alert_doc = inline("<script>window.alert()</script>")
-
-
-def set_window_rect(session, rect):
-    return session.transport.send("POST", "session/%s/window/rect" % session.session_id, rect)
-
-def is_fullscreen(session):
-    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
-    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
-    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
-
-
-# 10.7.2 Set Window Rect
-
-
-def test_current_top_level_browsing_context_no_longer_open(session, create_window):
-    """
-    1. If the current top-level browsing context is no longer open,
-    return error with error code no such window.
-
-    """
-    session.window_handle = create_window()
-    session.close()
-    response = set_window_rect(session, {})
-    assert_error(response, "no such window")
-
-
-def test_handle_prompt_dismiss():
-    """TODO"""
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - accept state
-           Accept the current user prompt.
-
-    """
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    original = session.window.rect
-
-    # step 2
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-    result = set_window_rect(session, {"x": original["x"],
-                                       "y": original["y"]})
-    assert result.status == 200
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-    result = set_window_rect(session, {"x": original["x"],
-                                       "y": original["y"]})
-    assert result.status == 200
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-    result = set_window_rect(session, {"x": original["x"],
-                                       "y": original["y"]})
-    assert_success(result)
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_dismiss_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
-    """TODO"""
-
-
-def test_handle_prompt_ignore():
-    """TODO"""
-
-
-def test_handle_prompt_missing_value(session, create_dialog):
-    """
-    2. Handle any user prompts and return its value if it is an error.
-
-    [...]
-
-    In order to handle any user prompts a remote end must take the
-    following steps:
-
-      [...]
-
-      2. Perform the following substeps based on the current session's
-      user prompt handler:
-
-        [...]
-
-        - missing value default state
-           1. Dismiss the current user prompt.
-           2. Return error with error code unexpected alert open.
-
-    """
-
-    original = session.window.rect
-
-    # step 2
-    create_dialog("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = set_window_rect(session, {"x": original["x"],
-                                       "y": original["y"]})
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = set_window_rect(session, {"x": original["x"],
-                                       "y": original["y"]})
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = set_window_rect(session, {"x": original["x"],
-                                       "y": original["y"]})
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-@pytest.mark.parametrize("rect", [
-    {"width": "a"},
-    {"height": "b"},
-    {"width": "a", "height": "b"},
-    {"x": "a"},
-    {"y": "b"},
-    {"x": "a", "y": "b"},
-    {"width": "a", "height": "b", "x": "a", "y": "b"},
-
-    {"width": True},
-    {"height": False},
-    {"width": True, "height": False},
-    {"x": True},
-    {"y": False},
-    {"x": True, "y": False},
-    {"width": True, "height": False, "x": True, "y": False},
-
-    {"width": []},
-    {"height": []},
-    {"width": [], "height": []},
-    {"x": []},
-    {"y": []},
-    {"x": [], "y": []},
-    {"width": [], "height": [], "x": [], "y": []},
-
-    {"height": {}},
-    {"width": {}},
-    {"height": {}, "width": {}},
-    {"x": {}},
-    {"y": {}},
-    {"x": {}, "y": {}},
-    {"width": {}, "height": {}, "x": {}, "y": {}},
-])
-def test_invalid_types(session, rect):
-    """
-    8. If width or height is neither null nor a Number from 0 to 2^31 -
-    1, return error with error code invalid argument.
-
-    9. If x or y is neither null nor a Number from -(2^31) to 2^31 - 1,
-    return error with error code invalid argument.
-    """
-    response = set_window_rect(session, rect)
-    assert_error(response, "invalid argument")
-
-
-@pytest.mark.parametrize("rect", [
-    {"width": -1},
-    {"height": -2},
-    {"width": -1, "height": -2},
-])
-def test_out_of_bounds(session, rect):
-    """
-    8. If width or height is neither null nor a Number from 0 to 2^31 -
-    1, return error with error code invalid argument.
-
-    9. If x or y is neither null nor a Number from -(2^31) to 2^31 - 1,
-    return error with error code invalid argument.
-    """
-    response = set_window_rect(session, rect)
-    assert_error(response, "invalid argument")
-
-
-def test_width_height_floats(session):
-    """
-    8. If width or height is neither null nor a Number from 0 to 2^31 -
-    1, return error with error code invalid argument.
-    """
-
-    response = set_window_rect(session, {"width": 500.5, "height": 420})
-    value = assert_success(response)
-    assert value["width"] == 500
-    assert value["height"] == 420
-
-    response = set_window_rect(session, {"width": 500, "height": 450.5})
-    value = assert_success(response)
-    assert value["width"] == 500
-    assert value["height"] == 450
-
-
-def test_x_y_floats(session):
-    """
-    9. If x or y is neither null nor a Number from -(2^31) to 2^31 - 1,
-    return error with error code invalid argument.
-    """
-
-    response = set_window_rect(session, {"x": 0.5, "y": 420})
-    value = assert_success(response)
-    assert value["x"] == 0
-    assert value["y"] == 420
-
-    response = set_window_rect(session, {"x": 100, "y": 450.5})
-    value = assert_success(response)
-    assert value["x"] == 100
-    assert value["y"] == 450
-
-
-@pytest.mark.parametrize("rect", [
-    {},
-
-    {"width": None},
-    {"height": None},
-    {"width": None, "height": None},
-
-    {"x": None},
-    {"y": None},
-    {"x": None, "y": None},
-
-    {"width": None, "x": None},
-    {"width": None, "y": None},
-    {"height": None, "x": None},
-    {"height": None, "Y": None},
-
-    {"width": None, "height": None, "x": None, "y": None},
-
-    {"width": 200},
-    {"height": 200},
-    {"x": 200},
-    {"y": 200},
-    {"width": 200, "x": 200},
-    {"height": 200, "x": 200},
-    {"width": 200, "y": 200},
-    {"height": 200, "y": 200},
-])
-def test_no_change(session, rect):
-    """
-    13. If width and height are not null:
-
-    [...]
-
-    14. If x and y are not null:
-
-    [...]
-
-    15. Return success with the JSON serialization of the current
-    top-level browsing context's window rect.
-    """
-
-    original = session.window.rect
-    response = set_window_rect(session, rect)
-    assert_success(response, original)
-
-
-def test_fully_exit_fullscreen(session):
-    """
-    10. Fully exit fullscreen.
-
-    [...]
-
-    To fully exit fullscreen a document document, run these steps:
-
-      1. If document's fullscreen element is null, terminate these steps.
-
-      2. Unfullscreen elements whose fullscreen flag is set, within
-      document's top layer, except for document's fullscreen element.
-
-      3. Exit fullscreen document.
-    """
-    session.window.fullscreen()
-    assert is_fullscreen(session) is True
-
-    response = set_window_rect(session, {"width": 400, "height": 400})
-    value = assert_success(response)
-    assert value["width"] == 400
-    assert value["height"] == 400
-
-    assert is_fullscreen(session) is False
-
-
-def test_restore_from_minimized(session):
-    """
-    12. If the visibility state of the top-level browsing context's
-    active document is hidden, restore the window.
-
-    [...]
-
-    To restore the window, given an operating system level window with
-    an associated top-level browsing context, run implementation-specific
-    steps to restore or unhide the window to the visible screen. Do not
-    return from this operation until the visibility state of the top-level
-    browsing context's active document has reached the visible state,
-    or until the operation times out.
-    """
-
-    session.window.minimize()
-    assert session.execute_script("return document.hidden") is True
-
-    response = set_window_rect(session, {"width": 450, "height": 450})
-    value = assert_success(response)
-    assert value["width"] == 450
-    assert value["height"] == 450
-
-    assert session.execute_script("return document.hidden") is False
-
-
-def test_restore_from_maximized(session):
-    """
-    12. If the visibility state of the top-level browsing context's
-    active document is hidden, restore the window.
-
-    [...]
-
-    To restore the window, given an operating system level window with
-    an associated top-level browsing context, run implementation-specific
-    steps to restore or unhide the window to the visible screen. Do not
-    return from this operation until the visibility state of the top-level
-    browsing context's active document has reached the visible state,
-    or until the operation times out.
-    """
-
-    original_size = session.window.size
-    session.window.maximize()
-    assert session.window.size != original_size
-
-    response = set_window_rect(session, {"width": 400, "height": 400})
-    value = assert_success(response)
-    assert value["width"] == 400
-    assert value["height"] == 400
-
-
-def test_height_width(session):
-    original = session.window.rect
-    max = session.execute_script("""
-        return {
-          width: window.screen.availWidth,
-          height: window.screen.availHeight,
-        }""")
-
-    # step 12
-    response = set_window_rect(session, {"width": max["width"] - 100,
-                                         "height": max["height"] - 100})
-
-    # step 14
-    assert_success(response, {"x": original["x"],
-                              "y": original["y"],
-                              "width": max["width"] - 100,
-                              "height": max["height"] - 100})
-
-
-def test_height_width_larger_than_max(session):
-    max = session.execute_script("""
-        return {
-          width: window.screen.availWidth,
-          height: window.screen.availHeight,
-        }""")
-
-    # step 12
-    response = set_window_rect(session, {"width": max["width"] + 100,
-                                         "height": max["height"] + 100})
-
-    # step 14
-    rect = assert_success(response)
-    assert rect["width"] >= max["width"]
-    assert rect["height"] >= max["height"]
-
-
-def test_height_width_as_current(session):
-    original = session.window.rect
-
-    # step 12
-    response = set_window_rect(session, {"width": original["width"],
-                                         "height": original["height"]})
-
-    # step 14
-    assert_success(response, {"x": original["x"],
-                              "y": original["y"],
-                              "width": original["width"],
-                              "height": original["height"]})
-
-
-def test_x_y(session):
-    original = session.window.rect
-
-    # step 13
-    response = set_window_rect(session, {"x": original["x"] + 10,
-                                         "y": original["y"] + 10})
-
-    # step 14
-    assert_success(response, {"x": original["x"] + 10,
-                              "y": original["y"] + 10,
-                              "width": original["width"],
-                              "height": original["height"]})
-
-
-def test_negative_x_y(session):
-    original = session.window.rect
-
-    # step 13
-    response = set_window_rect(session, {"x": - 8, "y": - 8})
-
-    # step 14
-    os = session.capabilities["platformName"]
-    # certain WMs prohibit windows from being moved off-screen
-    if os == "linux":
-        rect = assert_success(response)
-        assert rect["x"] <= 0
-        assert rect["y"] <= 0
-        assert rect["width"] == original["width"]
-        assert rect["height"] == original["height"]
-
-    # On macOS, windows can only be moved off the screen on the
-    # horizontal axis.  The system menu bar also blocks windows from
-    # being moved to (0,0).
-    elif os == "darwin":
-        assert_success(response, {"x": -8,
-                                  "y": 23,
-                                  "width": original["width"],
-                                  "height": original["height"]})
-
-    # It turns out that Windows is the only platform on which the
-    # window can be reliably positioned off-screen.
-    elif os == "windows_nt":
-        assert_success(response, {"x": -8,
-                                  "y": -8,
-                                  "width": original["width"],
-                                  "height": original["height"]})
-
-
-def test_move_to_same_position(session):
-    original_position = session.window.position
-    position = session.window.position = original_position
-    assert position == original_position
-
-
-def test_move_to_same_x(session):
-    original_x = session.window.position[0]
-    position = session.window.position = (original_x, 345)
-    assert position == (original_x, 345)
-
-
-def test_move_to_same_y(session):
-    original_y = session.window.position[1]
-    position = session.window.position = (456, original_y)
-    assert position == (456, original_y)
-
-
-def test_resize_to_same_size(session):
-    original_size = session.window.size
-    size = session.window.size = original_size
-    assert size == original_size
-
-
-def test_resize_to_same_width(session):
-    original_width = session.window.size[0]
-    size = session.window.size = (original_width, 345)
-    assert size == (original_width, 345)
-
-
-def test_resize_to_same_height(session):
-    original_height = session.window.size[1]
-    size = session.window.size = (456, original_height)
-    assert size == (456, original_height)
-
-
-def test_payload(session):
-    # step 14
-    response = set_window_rect(session, {"x": 400, "y": 400})
-
-    assert response.status == 200
-    assert isinstance(response.body["value"], dict)
-    value = response.body["value"]
-    assert "width" in value
-    assert "height" in value
-    assert "x" in value
-    assert "y" in value
-    assert isinstance(value["width"], int)
-    assert isinstance(value["height"], int)
-    assert isinstance(value["x"], int)
-    assert isinstance(value["y"], int)
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/__init__.py b/WebDriverTests/imported/w3c/webdriver/tests/state/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/get_element_attribute.py b/WebDriverTests/imported/w3c/webdriver/tests/state/get_element_attribute.py
deleted file mode 100644 (file)
index ce78e11..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-# META: timeout=long
-
-import pytest
-
-from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
-from tests.support.fixtures import create_dialog
-from tests.support.inline import inline
-
-
-def get_attribute(session, element, attr):
-    return session.transport.send("GET", "session/{session_id}/element/{element_id}/attribute/{attr}"
-                                  .format(session_id=session.session_id,
-                                          element_id=element,
-                                          attr=attr))
-
-
-# 13.2 Get Element Attribute
-
-def test_no_browsing_context(session, create_window):
-    # 13.2 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    result = get_attribute(session, "foo", "id")
-
-    assert_error(result, "no such window")
-
-
-def test_handle_prompt_dismiss(new_session, add_browser_capabilites):
-    # 13.2 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "dismiss"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    # 13.2 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session):
-    # 13.2 step 2
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = get_attribute(session, element.id, "id")
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_element_not_found(session):
-    # 13.2 Step 3
-    result = get_attribute(session, "foo", "id")
-
-    assert_error(result, "no such element")
-
-
-def test_element_stale(session):
-    # 13.2 step 4
-    session.url = inline("<input id=foo>")
-    element = session.find.css("input", all=False)
-    session.refresh()
-    result = get_attribute(session, element.id, "id")
-
-    assert_error(result, "stale element reference")
-
-
-def test_normal(session):
-    # 13.2 Step 5
-    session.url = inline("<input type=checkbox>")
-    element = session.find.css("input", all=False)
-    result = get_attribute(session, element.id, "input")
-    assert_success(result, None)
-    assert False == session.execute_script("return document.querySelector('input').checked")
-
-    # Check we are not returning the property which will have a different value
-    element.click()
-    assert True == session.execute_script("return document.querySelector('input').checked")
-    result = get_attribute(session, element.id, "input")
-    assert_success(result, None)
-
-
-@pytest.mark.parametrize("tag,attrs", [
-    ("audio", ["autoplay", "controls", "loop", "muted"]),
-    ("button", ["autofocus", "disabled", "formnovalidate"]),
-    ("details", ["open"]),
-    ("dialog", ["open"]),
-    ("fieldset", ["disabled"]),
-    ("form", ["novalidate"]),
-    ("iframe", ["allowfullscreen"]),
-    ("img", ["ismap"]),
-    ("input", ["autofocus", "checked", "disabled", "formnovalidate", "multiple", "readonly", "required"]),
-    ("menuitem", ["checked", "default", "disabled"]),
-    ("object", ["typemustmatch"]),
-    ("ol", ["reversed"]),
-    ("optgroup", ["disabled"]),
-    ("option", ["disabled", "selected"]),
-    ("script", ["async", "defer"]),
-    ("select", ["autofocus", "disabled", "multiple", "required"]),
-    ("textarea", ["autofocus", "disabled", "readonly", "required"]),
-    ("track", ["default"]),
-    ("video", ["autoplay", "controls", "loop", "muted"])
-])
-def test_boolean_attribute(session, tag, attrs):
-    # 13.2 Step 5
-    for attr in attrs:
-        session.url = inline("<{0} {1}>".format(tag, attr))
-
-        element = session.find.css(tag, all=False)
-        result = result = get_attribute(session, element.id, attr)
-        assert_success(result, "true")
-
-
-def test_global_boolean_attributes(session):
-    # 13.2 Step 5
-    session.url = inline("<p hidden>foo")
-    element = session.find.css("p", all=False)
-    result = result = get_attribute(session, element.id, "hidden")
-
-    assert_success(result, "true")
-
-    session.url = inline("<p>foo")
-    element = session.find.css("p", all=False)
-    result = result = get_attribute(session, element.id, "hidden")
-    assert_success(result, None)
-
-    session.url = inline("<p itemscope>foo")
-    element = session.find.css("p", all=False)
-    result = result = get_attribute(session, element.id, "itemscope")
-
-    assert_success(result, "true")
-
-    session.url = inline("<p>foo")
-    element = session.find.css("p", all=False)
-    result = result = get_attribute(session, element.id, "itemscope")
-    assert_success(result, None)
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/get_element_property.py b/WebDriverTests/imported/w3c/webdriver/tests/state/get_element_property.py
deleted file mode 100644 (file)
index e0d7801..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-# META: timeout=long
-
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.inline import inline
-from tests.support.fixtures import create_dialog
-
-_input = inline("<input id=i1>")
-
-
-# 13.3 Get Element Property
-
-def test_no_browsing_context(session, create_window):
-    # 13.3 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id="foo"))
-
-    assert_error(result, "no such window")
-
-
-def test_handle_prompt_dismiss(new_session, add_browser_capabilites):
-    # 13.3 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "dismiss"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    # 13.3 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "foo")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session):
-    # 13.3 step 2
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-def test_element_not_found(session):
-    # 13.3 Step 3
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id="foo"))
-
-    assert_error(result, "no such element")
-
-
-def test_element_stale(session):
-    # 13.3 step 4
-    session.url = _input
-    element = session.find.css("input", all=False)
-    session.refresh()
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/id"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "stale element reference")
-
-
-def test_element_non_existent(session):
-    # 13.3 step 5-7
-    session.url = _input
-    element = session.find.css("input", all=False)
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/foo"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, None)
-    assert None == session.execute_script("return arguments[0].foo",
-                                          args=[element])
-
-
-def test_element(session):
-    # 13.3 step 5-7
-    session.url = inline("<input type=checkbox>")
-    element = session.find.css("input", all=False)
-    element.click()
-    assert session.execute_script("return arguments[0].hasAttribute('checked')", args=(element,)) is False
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/property/checked"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-    assert_success(result, True)
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/get_element_tag_name.py b/WebDriverTests/imported/w3c/webdriver/tests/state/get_element_tag_name.py
deleted file mode 100644 (file)
index e3ed83f..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-# META: timeout=long
-
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.inline import inline
-from tests.support.fixtures import create_dialog
-
-
-# 13.6 Get Element Tag Name
-
-def test_no_browsing_context(session, create_window):
-    # 13.6 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id="foo"))
-
-    assert_error(result, "no such window")
-
-
-def test_handle_prompt_dismiss(new_session, add_browser_capabilites):
-    # 13.6 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "dismiss"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "input")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "input")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "input")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    # 13.6 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "input")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "input")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, "input")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session):
-    # 13.6 step 2
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_element_not_found(session):
-    # 13.6 Step 3
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id="foo"))
-
-    assert_error(result, "no such element")
-
-
-def test_element_stale(session):
-    # 13.6 step 4
-    session.url = inline("<input id=foo>")
-    element = session.find.css("input", all=False)
-    session.refresh()
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "stale element reference")
-
-
-def test_get_element_tag_name(session):
-    # 13.6 step 6
-    session.url = inline("<input id=foo>")
-    element = session.find.css("input", all=False)
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/name"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-    assert_success(result, "input")
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/is_element_selected.py b/WebDriverTests/imported/w3c/webdriver/tests/state/is_element_selected.py
deleted file mode 100644 (file)
index b51ba02..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-# META: timeout=long
-
-from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
-from tests.support.inline import inline
-from tests.support.fixtures import create_dialog
-
-
-alert_doc = inline("<script>window.alert()</script>")
-check_doc = inline("<input id=checked type=checkbox checked/><input id=notChecked type=checkbox/>")
-option_doc = inline("""<select>
-                        <option id=notSelected>r-</option>
-                        <option id=selected selected>r+</option>
-                       </select>
-                    """)
-
-
-# 13.1 Is Element Selected
-
-def test_no_browsing_context(session, create_window):
-    # 13.1 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id="foo"))
-
-    assert_error(result, "no such window")
-
-
-def test_handle_prompt_dismiss(new_session, add_browser_capabilites):
-    # 13.1 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "dismiss"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_accept(new_session, add_browser_capabilites):
-    # 13.1 step 2
-    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"unhandledPromptBehavior": "accept"})}})
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_handle_prompt_missing_value(session):
-    # 13.1 step 2
-    session.url = inline("<input id=foo>")
-    element = session.find.css("#foo", all=False)
-
-    create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #1")
-
-    create_dialog(session)("confirm", text="dismiss #2", result_var="dismiss2")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #2")
-
-    create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
-
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "unexpected alert open")
-    assert_dialog_handled(session, "dismiss #3")
-
-
-def test_element_stale(session):
-    # 13.1 step 4
-    session.url = check_doc
-    element = session.find.css("#checked", all=False)
-    session.refresh()
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_error(result, "stale element reference")
-
-
-def test_element_checked(session):
-    # 13.1 step 5
-    session.url = check_doc
-    element = session.find.css("#checked", all=False)
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, True)
-
-
-def test_checkbox_not_selected(session):
-    # 13.1 step 5
-    session.url = check_doc
-    element = session.find.css("#notChecked", all=False)
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
-
-
-def test_element_selected(session):
-    # 13.1 step 5
-    session.url = option_doc
-    element = session.find.css("#selected", all=False)
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, True)
-
-
-def test_element_not_selected(session):
-    # 13.1 step 5
-    session.url = option_doc
-    element = session.find.css("#notSelected", all=False)
-    result = session.transport.send("GET", "session/{session_id}/element/{element_id}/selected"
-                                    .format(session_id=session.session_id,
-                                            element_id=element.id))
-
-    assert_success(result, False)
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/text/__init__.py b/WebDriverTests/imported/w3c/webdriver/tests/state/text/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/state/text/get_text.py b/WebDriverTests/imported/w3c/webdriver/tests/state/text/get_text.py
deleted file mode 100644 (file)
index aa07b8d..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-import pytest
-import uuid
-
-from tests.support.asserts import assert_error, assert_success
-from tests.support.inline import inline
-
-# For failing tests, the Get Element Text end-point is used
-# directly. In all other cases, the Element.text() function is used.
-
-def test_getting_text_of_a_non_existant_element_is_an_error(session):
-   session.url = inline("""<body>Hello world</body>""")
-   id = uuid.uuid4()
-
-   result = session.transport.send(
-       "GET",
-       "session/%s/element/%s/text" % (session.session_id, id))
-
-   assert_error(result, "no such element")
-
-
-def test_read_element_text(session):
-    session.url = inline("""
-        <body>
-          Noise before <span id='id'>This has an ID</span>. Noise after
-        </body>""")
-
-    element = session.find.css("#id", all=False)
-
-    assert element.text == "This has an ID"
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/switch_to_parent_frame.py b/WebDriverTests/imported/w3c/webdriver/tests/switch_to_parent_frame.py
deleted file mode 100644 (file)
index 2e5c4e9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-import pytest
-from webdriver import StaleElementReferenceException
-
-from tests.support.inline import inline, iframe
-
-
-def switch_to_parent_frame(session):
-    return session.transport.send("POST", "session/%s/frame/parent" % session.session_id)
-
-
-def test_stale_element_from_iframe(session):
-    session.url = inline(iframe("<p>foo"))
-    frame_element = session.find.css("iframe", all=False)
-    session.switch_frame(frame_element)
-    stale_element = session.find.css("p", all=False)
-    switch_to_parent_frame(session)
-    with pytest.raises(StaleElementReferenceException):
-        stale_element.text
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/accept_alert.py b/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/accept_alert.py
deleted file mode 100644 (file)
index d47ed1c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-from tests.support.asserts import assert_error, assert_success
-from tests.support.inline import inline
-
-
-def accept_alert(session):
-    return session.transport.send("POST", "session/{session_id}/alert/accept"
-                                  .format(session_id=session.session_id))
-
-
-# 18.2 Accept Alert
-
-def test_no_browsing_context(session, create_window):
-    # 18.2 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    response = accept_alert(session)
-    assert_error(response, "no such window")
-
-
-def test_no_user_prompt(session):
-    # 18.2 step 2
-    response = accept_alert(session)
-    assert_error(response, "no such alert")
-
-
-def test_accept_alert(session):
-    # 18.2 step 3
-    session.url = inline("<script>window.alert('Hello');</script>")
-    response = accept_alert(session)
-    assert_success(response)
-
-
-def test_accept_confirm(session):
-    # 18.2 step 3
-    session.url = inline("<script>window.result = window.confirm('Hello');</script>")
-    response = accept_alert(session)
-    assert_success(response)
-    assert session.execute_script("return window.result") is True
-
-
-def test_accept_prompt(session):
-    # 18.2 step 3
-    session.url = inline("<script>window.result = window.prompt('Enter Your Name: ', 'Federer');</script>")
-    response = accept_alert(session)
-    assert_success(response)
-    assert session.execute_script("return window.result") == "Federer"
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/dismiss_alert.py b/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/dismiss_alert.py
deleted file mode 100644 (file)
index 6a20496..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-from tests.support.asserts import assert_error, assert_success
-from tests.support.inline import inline
-
-
-def dismiss_alert(session):
-    return session.transport.send("POST", "session/{session_id}/alert/dismiss"
-                                  .format(session_id=session.session_id))
-
-
-# 18.1 Dismiss Alert
-
-def test_no_browsing_context(session, create_window):
-    # 18.1 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    response = dismiss_alert(session)
-    assert_error(response, "no such window")
-
-
-def test_no_user_prompt(session):
-    # 18.1 step 2
-    response = dismiss_alert(session)
-    assert_error(response, "no such alert")
-
-
-def test_dismiss_alert(session):
-    # 18.1 step 3
-    session.url = inline("<script>window.alert('Hello');</script>")
-    response = dismiss_alert(session)
-    assert_success(response)
-
-
-def test_dismiss_confirm(session):
-    # 18.1 step 3
-    session.url = inline("<script>window.result = window.confirm('Hello');</script>")
-    response = dismiss_alert(session)
-    assert_success(response)
-    assert session.execute_script("return window.result;") is False
-
-
-def test_dismiss_prompt(session):
-    # 18.1 step 3
-    session.url = inline("<script>window.result = window.prompt('Enter Your Name: ', 'Federer');</script>")
-    response = dismiss_alert(session)
-    assert_success(response)
-    assert session.execute_script("return window.result") is None
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/get_alert_text.py b/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/get_alert_text.py
deleted file mode 100644 (file)
index 7b71f7f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-from tests.support.asserts import assert_error, assert_success
-from tests.support.inline import inline
-
-
-def get_dialog_text(session):
-    return session.transport.send("GET", "session/{session_id}/alert/text"
-                                  .format(session_id=session.session_id))
-
-
-# 18.3 Get Alert Text
-
-def test_no_browsing_context(session, create_window):
-    # 18.3 step 1
-    session.window_handle = create_window()
-    session.close()
-
-    response = get_dialog_text(session)
-    assert_error(response, "no such window")
-
-
-def test_no_user_prompt(session):
-    # 18.3 step 2
-    response = get_dialog_text(session)
-    assert_error(response, "no such alert")
-
-
-def test_get_alert_text(session):
-    # 18.3 step 3
-    session.url = inline("<script>window.alert('Hello');</script>")
-    response = get_dialog_text(session)
-    assert_success(response)
-    assert isinstance(response.body, dict)
-    assert "value" in response.body
-    alert_text = response.body["value"]
-    assert isinstance(alert_text, basestring)
-    assert alert_text == "Hello"
-
-
-def test_get_confirm_text(session):
-    # 18.3 step 3
-    session.url = inline("<script>window.confirm('Hello');</script>")
-    response = get_dialog_text(session)
-    assert_success(response)
-    assert isinstance(response.body, dict)
-    assert "value" in response.body
-    confirm_text = response.body["value"]
-    assert isinstance(confirm_text, basestring)
-    assert confirm_text == "Hello"
-
-
-def test_get_prompt_text(session):
-    # 18.3 step 3
-    session.url = inline("<script>window.prompt('Enter Your Name: ', 'Federer');</script>")
-    response = get_dialog_text(session)
-    assert_success(response)
-    assert isinstance(response.body, dict)
-    assert "value" in response.body
-    prompt_text = response.body["value"]
-    assert isinstance(prompt_text, basestring)
-    assert prompt_text == "Enter Your Name: "
diff --git a/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/send_alert_text.py b/WebDriverTests/imported/w3c/webdriver/tests/user_prompts/send_alert_text.py
deleted file mode 100644 (file)
index 6769b55..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-import pytest
-
-from tests.support.asserts import assert_error, assert_success
-from tests.support.inline import inline
-
-def send_alert_text(session, body=None):
-    return session.transport.send("POST", "session/{session_id}/alert/text"
-                                  .format(session_id=session.session_id), body)
-
-
-# 18.4 Send Alert Text
-
-@pytest.mark.parametrize("text", [None, {}, [], 42, True])
-def test_invalid_input(session, text):
-    # 18.4 step 2
-    session.url = inline("<script>window.result = window.prompt('Enter Your Name: ', 'Name');</script>")
-    response = send_alert_text(session, {"text": text})
-    assert_error(response, "invalid argument")
-
-
-def test_no_browsing_context(session, create_window):
-    # 18.4 step 3
-    session.window_handle = create_window()
-    session.close()
-    body = {"text": "Federer"}
-    response = send_alert_text(session, body)
-    assert_error(response, "no such window")
-
-
-def test_no_user_prompt(session):
-    # 18.4 step 4
-    body = {"text": "Federer"}
-    response = send_alert_text(session, body)
-    assert_error(response, "no such alert")
-
-
-def test_alert_element_not_interactable(session):
-    # 18.4 step 5
-    session.url = inline("<script>window.alert('Hello');</script>")
-    body = {"text": "Federer"}
-    response = send_alert_text(session, body)
-    assert_error(response, "element not interactable")
-
-
-def test_confirm_element_not_interactable(session):
-    # 18.4 step 5
-    session.url = inline("<script>window.confirm('Hello');</script>")
-    body = {"text": "Federer"}
-    response = send_alert_text(session, body)
-    assert_error(response, "element not interactable")
-
-
-def test_send_alert_text(session):
-    # 18.4 step 6
-    session.url = inline("<script>window.result = window.prompt('Enter Your Name: ', 'Name');</script>")
-    body = {"text": "Federer"}
-    send_response = send_alert_text(session, body)
-    assert_success(send_response)
-    accept_response = session.transport.send("POST", "session/{session_id}/alert/accept"
-                                             .format(session_id=session.session_id))
-    assert_success(accept_response)
-    assert session.execute_script("return window.result") == "Federer"
-
-
-def test_send_alert_text_with_whitespace(session):
-    # 18.4 step 6
-    session.url = inline("<script>window.result = window.prompt('Enter Your Name: ', 'Name');</script>")
-    body = {"text": " Fed erer "}
-    send_response = send_alert_text(session, body)
-    assert_success(send_response)
-    accept_response = session.transport.send("POST", "session/{session_id}/alert/accept"
-                                             .format(session_id=session.session_id))
-    assert_success(accept_response)
-    assert session.execute_script("return window.result") == " Fed erer "