Title: [185115] trunk/LayoutTests
Revision
185115
Author
beid...@apple.com
Date
2015-06-02 12:40:13 -0700 (Tue, 02 Jun 2015)

Log Message

Add more tests for "should open external urls" flag.
https://bugs.webkit.org/show_bug.cgi?id=145558

Rubberstamped by Geoff Garen.

* loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true-expected.txt: Added.
* loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true.html: Added.
* loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false-expected.txt: Added.
* loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false.html: Added.
* loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture-expected.txt: Added.
* loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture.html: Added.
* loader/navigation-policy/should-open-external-urls/resources/do-nothing.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (185114 => 185115)


--- trunk/LayoutTests/ChangeLog	2015-06-02 19:28:11 UTC (rev 185114)
+++ trunk/LayoutTests/ChangeLog	2015-06-02 19:40:13 UTC (rev 185115)
@@ -1,3 +1,18 @@
+2015-06-02  Brady Eidson  <beid...@apple.com>
+
+        Add more tests for "should open external urls" flag.
+        https://bugs.webkit.org/show_bug.cgi?id=145558
+
+        Rubber-stamped by Geoff Garen.
+
+        * loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true-expected.txt: Added.
+        * loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true.html: Added.
+        * loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false-expected.txt: Added.
+        * loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false.html: Added.
+        * loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture-expected.txt: Added.
+        * loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture.html: Added.
+        * loader/navigation-policy/should-open-external-urls/resources/do-nothing.html: Added.
+
 2015-06-02  Xabier Rodriguez Calvar  <calva...@igalia.com> and Youenn Fablet <youenn.fab...@crf.canon.fr>
 
         [Streams API] Implement ReadableStreamReader read method in closed and errored state
@@ -23,7 +38,7 @@
         * streams/reference-implementation/readable-stream-templated-expected.txt:
         * streams/reference-implementation/readable-stream-templated.html:
         * streams/reference-implementation/readable-stream.html:
-
+        
 2015-06-02  Brady Eidson  <beid...@apple.com>
 
         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true-expected.txt (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true-expected.txt	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,5 @@
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL resources/do-nothing, main document URL resources/do-nothing, http method GET> is main frame - yes should open URLs externally - no
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL resources/notify-done.html, main document URL resources/notify-done.html, http method GET> is main frame - yes should open URLs externally - yes
+

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true.html (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true.html	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-false-followed-by-api-true.html	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,11 @@
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpPolicyDelegateCallbacks();
+    testRunner.queueLoad("resources/do-nothing");
+    testRunner.queueLoad("resources/notify-done.html", "", true);
+}
+</script>
+This test loads a page via API with the flag not set.<br>
+It then loads a page via API with the flag set to true.<br>
+The first load should have the flag defaulted to false, the second load should have it be true.<br>

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false-expected.txt (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false-expected.txt	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,5 @@
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL resources/do-nothing, main document URL resources/do-nothing, http method GET> is main frame - yes should open URLs externally - yes
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL resources/notify-done.html, main document URL resources/notify-done.html, http method GET> is main frame - yes should open URLs externally - no
+

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false.html (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false.html	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/api-true-followed-by-api-false.html	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,11 @@
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpPolicyDelegateCallbacks();
+    testRunner.queueLoad("resources/do-nothing", "", true);
+    testRunner.queueLoad("resources/notify-done.html");
+}
+</script>
+This test loads a page via API with the flag set to true.<br>
+It then loads a page via API with the flag not set.<br>
+The second load should have the flag defaulted to false.<br>

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture-expected.txt (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture-expected.txt	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,3 @@
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL resources/notify-done.html, main document URL resources/notify-done.html, http method GET> is main frame - yes should open URLs externally - no
+

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture.html (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture.html	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/dispatch-event-click-is-not-user-gesture.html	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,22 @@
+<script>
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpPolicyDelegateCallbacks();
+    testRunner.waitUntilDone();
+}
+
+function runTest()
+{
+    var event = top.document.createEvent('MouseEvent');
+    event.initEvent('click', true, true);
+    document.getElementById('a').dispatchEvent(event);
+}
+
+</script>
+
+<body _onload_="runTest();">
+This test "clicks" a link using dispatchEvent and checks the "should open external URLs" flag.<br>
+Since the fake click is not a user gesture, the flag should be false.<br>
+<a id="a" href="" me to finish</a>
+</body>

Added: trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/resources/do-nothing.html (0 => 185115)


--- trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/resources/do-nothing.html	                        (rev 0)
+++ trunk/LayoutTests/loader/navigation-policy/should-open-external-urls/resources/do-nothing.html	2015-06-02 19:40:13 UTC (rev 185115)
@@ -0,0 +1,3 @@
+<body>
+This page does nothing.
+</body>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to