Bug 1392368 - Add boilerplate for missing user prompt tests. r?automatedtester
MozReview-Commit-ID: KSSEG6MJD8m
--- a/testing/web-platform/meta/webdriver/tests/set_window_rect.py.ini
+++ b/testing/web-platform/meta/webdriver/tests/set_window_rect.py.ini
@@ -1,7 +1,7 @@
[set_window_rect.py]
type: wdspec
- [set_window_rect.py::test_prompt_accept]
+ [set_window_rect.py::test_handle_prompt_accept]
expected: FAIL
[set_window_rect.py::test_handle_prompt_missing_value]
expected: FAIL
--- a/testing/web-platform/tests/webdriver/tests/set_window_rect.py
+++ b/testing/web-platform/tests/webdriver/tests/set_window_rect.py
@@ -10,17 +10,41 @@ alert_doc = inline("<script>window.alert
def set_window_rect(session, rect):
return session.transport.send("POST", "session/%s/window/rect" % session.session_id, rect)
# 10.7.2 Set Window Rect
-def test_prompt_accept(new_session):
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_accept(new_session):
+ """
+ 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(
{"alwaysMatch": {"unhandledPromptBehavior": "accept"}})
session.url = inline("<title>WD doc title</title>")
original = session.window.rect
# step 2
create_dialog(session)("alert", text="dismiss #1", result_var="dismiss1")
result = set_window_rect(session, {"x": int(original["x"]),
@@ -36,17 +60,50 @@ def test_prompt_accept(new_session):
create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
result = set_window_rect(session, {"x": int(original["x"]),
"y": int(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
session.url = inline("<title>WD doc title</title>")
create_dialog("alert", text="dismiss #1", result_var="dismiss1")
result = set_window_rect(session, {"x": int(original["x"]),
"y": int(original["y"])})