Title: [211373] trunk/LayoutTests
Revision
211373
Author
dba...@webkit.org
Date
2017-01-30 10:14:25 -0800 (Mon, 30 Jan 2017)

Log Message

[QuickLook] Make HTTP QuickLook tests work in Apple Internal DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=167483

Reviewed by Andy Estes.

Write QuickLook tests that tap a hyperlink in terms of UIHelper (in LayoutTests/resources/ui-helper.js)
so that we can run these tests in an Apple Internal build of DumpRenderTree.

* http/tests/quicklook/at-import-stylesheet-blocked.html: Write in terms of UIHelper.
* http/tests/quicklook/base-url-blocked.html: Ditto.
* http/tests/quicklook/cross-origin-iframe-blocked.html: Ditto.
* http/tests/quicklook/document-domain-is-empty-string.html: Ditto.
* http/tests/quicklook/external-stylesheet-blocked.html: Ditto.
* http/tests/quicklook/hide-referer-on-navigation.html: Ditto.
* http/tests/quicklook/resources/tap-at-point-and-notify-done.js: Removed.
* http/tests/quicklook/resources/tap-run-test-hyperlink.js: Added.
(runTest):
* http/tests/quicklook/submit-form-blocked.html: Ditto.
* http/tests/quicklook/top-navigation-blocked.html: Ditto.
* platform/ios-simulator-wk1/TestExpectations: Unskip QuickLook tests as we can now run
them in an Apple Internal build of DumpRenderTree. Note that these test are listed in
file LayoutTests/platform/ios-simulator/TestExpectations so that they are skipped in
WebKit for iOS Simulator built with the public iOS SDK as we need to fix <https://bugs.webkit.org/show_bug.cgi?id=141906>.
* platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt: Added.
For some reason the console message "Unsafe _javascript_ attempt to initiate navigation" includes
a line number in DumpRenderTree (why?). This line number is not emitted when the test is run
in WebKitTestRunner. Add platform-specific result for now.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (211372 => 211373)


--- trunk/LayoutTests/ChangeLog	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/ChangeLog	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,3 +1,33 @@
+2017-01-30  Daniel Bates  <daba...@apple.com>
+
+        [QuickLook] Make HTTP QuickLook tests work in Apple Internal DumpRenderTree
+        https://bugs.webkit.org/show_bug.cgi?id=167483
+
+        Reviewed by Andy Estes.
+
+        Write QuickLook tests that tap a hyperlink in terms of UIHelper (in LayoutTests/resources/ui-helper.js)
+        so that we can run these tests in an Apple Internal build of DumpRenderTree.
+
+        * http/tests/quicklook/at-import-stylesheet-blocked.html: Write in terms of UIHelper.
+        * http/tests/quicklook/base-url-blocked.html: Ditto.
+        * http/tests/quicklook/cross-origin-iframe-blocked.html: Ditto.
+        * http/tests/quicklook/document-domain-is-empty-string.html: Ditto.
+        * http/tests/quicklook/external-stylesheet-blocked.html: Ditto.
+        * http/tests/quicklook/hide-referer-on-navigation.html: Ditto.
+        * http/tests/quicklook/resources/tap-at-point-and-notify-done.js: Removed.
+        * http/tests/quicklook/resources/tap-run-test-hyperlink.js: Added.
+        (runTest):
+        * http/tests/quicklook/submit-form-blocked.html: Ditto.
+        * http/tests/quicklook/top-navigation-blocked.html: Ditto.
+        * platform/ios-simulator-wk1/TestExpectations: Unskip QuickLook tests as we can now run
+        them in an Apple Internal build of DumpRenderTree. Note that these test are listed in
+        file LayoutTests/platform/ios-simulator/TestExpectations so that they are skipped in
+        WebKit for iOS Simulator built with the public iOS SDK as we need to fix <https://bugs.webkit.org/show_bug.cgi?id=141906>.
+        * platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt: Added.
+        For some reason the console message "Unsafe _javascript_ attempt to initiate navigation" includes
+        a line number in DumpRenderTree (why?). This line number is not emitted when the test is run
+        in WebKitTestRunner. Add platform-specific result for now.
+
 2017-01-30  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Skip more tests timing out in GTK+ bots.

Modified: trunk/LayoutTests/http/tests/quicklook/at-import-stylesheet-blocked.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/at-import-stylesheet-blocked.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/at-import-stylesheet-blocked.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
 <body>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/base-url-blocked.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/base-url-blocked.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/base-url-blocked.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,16 +1,15 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
-if (window.testRunner) {
+if (window.testRunner)
     testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
 </script>
 </head>
 <body>
 <p>This test verifies that a base URL is blocked when using QuickLook to preview a Microsoft Word document. This test PASSED only if a security error is logged to the console.</p>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/cross-origin-iframe-blocked.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/cross-origin-iframe-blocked.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/cross-origin-iframe-blocked.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,17 +1,17 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
 <body>
 <p>This test verifies that loading a cross-origin iframe is blocked when created by a QuickLook preview of a Microsoft Word document. This test PASSED only if a security error is logged to the console.</p>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/document-domain-is-empty-string.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/document-domain-is-empty-string.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/document-domain-is-empty-string.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
 <body>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/external-stylesheet-blocked.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/external-stylesheet-blocked.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/external-stylesheet-blocked.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
 <body>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/hide-referer-on-navigation.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/hide-referer-on-navigation.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/hide-referer-on-navigation.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,20 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
-function doTest(){
-    tapAtPointAndNotifyDone(document.getElementsByTagName('iframe')[0].offsetLeft + 5, document.getElementsByTagName('iframe')[0].offsetTop + 5)
-}
-
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
-<body _onload_="doTest()">
+<body _onload_="runTest(document.querySelector('iframe'))">
 <p>This test verifies that the HTTP referrer is hidden when navigating from a Microsoft Word QuickLook preview. This test PASSED only if nothing is printed below.</p>
 
 <iframe src=""

Deleted: trunk/LayoutTests/http/tests/quicklook/resources/tap-at-point-and-notify-done.js (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/resources/tap-at-point-and-notify-done.js	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/resources/tap-at-point-and-notify-done.js	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,18 +0,0 @@
-function tapAtPointAndNotifyDone(x, y)
-{
-    tapAtPoint(x, y, function () { testRunner.notifyDone(); })
-}
-
-function tapAtPoint(x, y, callback)
-{
-    if (!window.testRunner || !testRunner.runUIScript)
-        return;
-
-    var uiScript = `
-    (function() {
-        uiController.singleTapAtPoint(${x}, ${y}, function() {
-            uiController.uiScriptComplete("Done");
-        });
-    })();`
-    testRunner.runUIScript(uiScript, callback);
-}

Added: trunk/LayoutTests/http/tests/quicklook/resources/tap-run-test-hyperlink.js (0 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/resources/tap-run-test-hyperlink.js	                        (rev 0)
+++ trunk/LayoutTests/http/tests/quicklook/resources/tap-run-test-hyperlink.js	2017-01-30 18:14:25 UTC (rev 211373)
@@ -0,0 +1,12 @@
+function runTest(frame, offsetInFrame)
+{
+    if (!window.testRunner)
+        return;
+
+    offsetInFrame = offsetInFrame || 5;
+
+    // FIXME: For some reason the (x, y) coordinates of the hyperlink "Run test" is offset 2 pixels
+    // in legacy WebKit (why?).
+    var fudgeFactor = UIHelper.isWebKit2() ? 0 : 2;
+    UIHelper.wait(UIHelper.activateAt(frame.offsetLeft + offsetInFrame + fudgeFactor, frame.offsetTop + offsetInFrame + fudgeFactor));
+}

Modified: trunk/LayoutTests/http/tests/quicklook/rtf-document-domain-is-empty-string.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/rtf-document-domain-is-empty-string.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/rtf-document-domain-is-empty-string.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -2,25 +2,15 @@
 <html>
 <head>
 <script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
 }
-
-function runTest(frame)
-{
-    if (!window.testRunner)
-        return;
-
-    // FIXME: For some reason the (x, y) coordinates of the hyperlink "Run test" is offset 2 pixels
-    // in legacy WebKit (why?).
-    var fudgeFactor = UIHelper.isWebKit2() ? 0 : 2;
-    UIHelper.wait(UIHelper.activateAt(frame.offsetLeft + 8 + fudgeFactor, frame.offsetTop + 8 + fudgeFactor));
-}
 </script>
 </head>
 <body>
-<iframe src="" _onload_="runTest(this)"></iframe>
+<iframe src="" _onload_="runTest(this, 8 /* offsetInFrame */)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/submit-form-blocked.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/submit-form-blocked.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/submit-form-blocked.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
 <body>
 <p>This test verifies that form submission is blocked using QuickLook to preview a Microsoft Word document. This test PASSED only if a security error is logged to the console.</p>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/quicklook/top-navigation-blocked.html (211372 => 211373)


--- trunk/LayoutTests/http/tests/quicklook/top-navigation-blocked.html	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/http/tests/quicklook/top-navigation-blocked.html	2017-01-30 18:14:25 UTC (rev 211373)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.waitUntilDone();
 }
 </script>
 </head>
 <body>
-<iframe src="" _onload_="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
+<iframe src="" _onload_="runTest(this)"></iframe>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (211372 => 211373)


--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2017-01-30 18:13:11 UTC (rev 211372)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2017-01-30 18:14:25 UTC (rev 211373)
@@ -2,20 +2,6 @@
 #
 # See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
 
-# FIXME: uiController.singleTapAtPoint() is not implemented in DumpRenderTree. And
-# we cannot write these tests in terms of EventSender without identifying which
-# test tool is being used to run the test, which is not straightforward at the time
-# of writing (10/07/2016).
-http/tests/quicklook/at-import-stylesheet-blocked.html
-http/tests/quicklook/base-url-blocked.html
-http/tests/quicklook/cross-origin-iframe-blocked.html
-http/tests/quicklook/document-domain-is-empty-string.html
-http/tests/quicklook/external-stylesheet-blocked.html
-http/tests/quicklook/hide-referer-on-navigation.html
-http/tests/quicklook/resources/fail.html
-http/tests/quicklook/submit-form-blocked.html
-http/tests/quicklook/top-navigation-blocked.html
-
 # Selectively re-enable viewport tests that work
 fast/viewport/ios/ipad/width-is-device-width.html [ Pass ]
 

Added: trunk/LayoutTests/platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt (0 => 211373)


--- trunk/LayoutTests/platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt	2017-01-30 18:14:25 UTC (rev 211373)
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: line 1: Viewport argument value "612;" for key "width" was truncated to its numeric prefix. Note that ';' is not a separator in viewport values. The list should be comma-separated.
+CONSOLE MESSAGE: line 38: Unsafe _javascript_ attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/quicklook/top-navigation-blocked.html' from frame with URL 'http://127.0.0.1:8000/quicklook/resources/top-navigation-blocked.docx'. The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set.
+
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+Run test
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to