Bug 1468185 - [geckodriver] Add support for all unhandledPromptBehavior options. draft
authorHenrik Skupin <mail@hskupin.info>
Mon, 11 Jun 2018 08:50:58 -0700
changeset 806816 0c48ea956fb5dcf42a102e8c011067e45931c1c1
parent 806789 62ab31ea0ec73e72a1ea9d44c9c4b003813b6724
push id112963
push userbmo:hskupin@gmail.com
push dateTue, 12 Jun 2018 00:34:36 +0000
bugs1468185
milestone62.0a1
Bug 1468185 - [geckodriver] Add support for all unhandledPromptBehavior options. geckodriver currently only supports "accept" and "dismiss". But to be compliant with the WebDriver specification all allowed options have to be supported. Given that Marionette uses the hard-coded dismiss and notify behavior for unexpected prompts, inappropriately marked as failed tests for accept/dismiss + notify for execute_(async_)script will pass now. MozReview-Commit-ID: 14kRTpvJYjZ
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/webdriver/tests/execute_async_script/user_prompts.py.ini
testing/web-platform/meta/webdriver/tests/execute_script/user_prompts.py.ini
testing/web-platform/tests/webdriver/tests/execute_async_script/user_prompts.py
testing/web-platform/tests/webdriver/tests/execute_script/user_prompts.py
testing/webdriver/src/capabilities.rs
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -404290,17 +404290,19 @@
     [
      "/webdriver/tests/execute_async_script/collections.py",
      {}
     ]
    ],
    "webdriver/tests/execute_async_script/user_prompts.py": [
     [
      "/webdriver/tests/execute_async_script/user_prompts.py",
-     {}
+     {
+      "timeout": "long"
+     }
     ]
    ],
    "webdriver/tests/execute_script/collections.py": [
     [
      "/webdriver/tests/execute_script/collections.py",
      {}
     ]
    ],
@@ -404314,17 +404316,19 @@
     [
      "/webdriver/tests/execute_script/json_serialize_windowproxy.py",
      {}
     ]
    ],
    "webdriver/tests/execute_script/user_prompts.py": [
     [
      "/webdriver/tests/execute_script/user_prompts.py",
-     {}
+     {
+      "timeout": "long"
+     }
     ]
    ],
    "webdriver/tests/find_element/find.py": [
     [
      "/webdriver/tests/find_element/find.py",
      {}
     ]
    ],
@@ -618615,17 +618619,17 @@
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
   "webdriver/tests/execute_async_script/collections.py": [
    "d6c95dfdcbfc3b9cf91cf6f943a17b7cd0fee79d",
    "wdspec"
   ],
   "webdriver/tests/execute_async_script/user_prompts.py": [
-   "8b161d459074d7e2a3e726663cedfb1cd8636f0b",
+   "d89434bc628d4800f2a5a8554e7cdcbba3b6c1e7",
    "wdspec"
   ],
   "webdriver/tests/execute_script/__init__.py": [
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
   "webdriver/tests/execute_script/collections.py": [
    "0ee4e340b38b6aa59043286755822460e76b2dbd",
@@ -618635,17 +618639,17 @@
    "21bae43b3a6e966b8698b7c439b29a68029adc58",
    "wdspec"
   ],
   "webdriver/tests/execute_script/json_serialize_windowproxy.py": [
    "20db10d82ed2b28a22674fcdc37cac0323d33c95",
    "wdspec"
   ],
   "webdriver/tests/execute_script/user_prompts.py": [
-   "0e94c156954b90eca2005f6ad9fa5a4601169fd9",
+   "d87cc66a9d1e0003a3973b86e541b62999e9975f",
    "wdspec"
   ],
   "webdriver/tests/find_element/__init__.py": [
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
   "webdriver/tests/find_element/find.py": [
    "9af0db4de0d09cbf68fa43bb40145cffc7b95635",
--- a/testing/web-platform/meta/webdriver/tests/execute_async_script/user_prompts.py.ini
+++ b/testing/web-platform/meta/webdriver/tests/execute_async_script/user_prompts.py.ini
@@ -2,21 +2,15 @@
   disabled:
     if webrender: bug 1425588
   [test_handle_prompt_accept]
     expected: FAIL
 
   [test_handle_prompt_dismiss]
     expected: FAIL
 
-  [test_handle_prompt_dismiss_and_notify]
-    expected: FAIL
-
-  [test_handle_prompt_accept_and_notify]
-    expected: FAIL
-
   [test_handle_prompt_ignore]
     expected: FAIL
 
   [test_handle_prompt_twice]
     expected: FAIL
     disabled: Bug 1459118
 
--- a/testing/web-platform/meta/webdriver/tests/execute_script/user_prompts.py.ini
+++ b/testing/web-platform/meta/webdriver/tests/execute_script/user_prompts.py.ini
@@ -2,21 +2,15 @@
   disabled:
     if webrender: bug 1425588
   [test_handle_prompt_accept]
     expected: FAIL
 
   [test_handle_prompt_dismiss]
     expected: FAIL
 
-  [test_handle_prompt_dismiss_and_notify]
-    expected: FAIL
-
-  [test_handle_prompt_accept_and_notify]
-    expected: FAIL
-
   [test_handle_prompt_ignore]
     expected: FAIL
 
   [test_handle_prompt_twice]
     expected: FAIL
     disabled: Bug 1459118
 
--- a/testing/web-platform/tests/webdriver/tests/execute_async_script/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/execute_async_script/user_prompts.py
@@ -1,8 +1,10 @@
+# META: timeout=long
+
 import pytest
 
 from webdriver import error
 
 from tests.support.asserts import assert_success
 
 
 def execute_async_script(session, script, args=None):
--- a/testing/web-platform/tests/webdriver/tests/execute_script/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/execute_script/user_prompts.py
@@ -1,8 +1,10 @@
+# META: timeout=long
+
 import pytest
 
 from webdriver import error
 
 from tests.support.asserts import assert_success
 
 
 def execute_script(session, script, args=None):
--- a/testing/webdriver/src/capabilities.rs
+++ b/testing/webdriver/src/capabilities.rs
@@ -291,17 +291,21 @@ impl SpecNewSessionParameters {
     fn validate_unhandled_prompt_behaviour(value: &Json) -> WebDriverResult<()> {
         let behaviour = try_opt!(
             value.as_string(),
             ErrorStatus::InvalidArgument,
             format!("unhandledPromptBehavior is not a string: {}", value)
         );
 
         match behaviour {
-            "dismiss" | "accept" => {}
+            "accept" |
+            "accept and notify" |
+            "dismiss" |
+            "dismiss and notify" |
+            "ignore" => {},
             x => {
                 return Err(WebDriverError::new(
                     ErrorStatus::InvalidArgument,
                     format!("Invalid unhandledPromptBehavior value: {}", x),
                 ))
             }
         }