Changeset 211373 in webkit


Ignore:
Timestamp:
Jan 30, 2017 10:14:25 AM (7 years ago)
Author:
dbates@webkit.org
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.

Location:
trunk/LayoutTests
Files:
3 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211361 r211373  
     12017-01-30  Daniel Bates  <dabates@apple.com>
     2
     3        [QuickLook] Make HTTP QuickLook tests work in Apple Internal DumpRenderTree
     4        https://bugs.webkit.org/show_bug.cgi?id=167483
     5
     6        Reviewed by Andy Estes.
     7
     8        Write QuickLook tests that tap a hyperlink in terms of UIHelper (in LayoutTests/resources/ui-helper.js)
     9        so that we can run these tests in an Apple Internal build of DumpRenderTree.
     10
     11        * http/tests/quicklook/at-import-stylesheet-blocked.html: Write in terms of UIHelper.
     12        * http/tests/quicklook/base-url-blocked.html: Ditto.
     13        * http/tests/quicklook/cross-origin-iframe-blocked.html: Ditto.
     14        * http/tests/quicklook/document-domain-is-empty-string.html: Ditto.
     15        * http/tests/quicklook/external-stylesheet-blocked.html: Ditto.
     16        * http/tests/quicklook/hide-referer-on-navigation.html: Ditto.
     17        * http/tests/quicklook/resources/tap-at-point-and-notify-done.js: Removed.
     18        * http/tests/quicklook/resources/tap-run-test-hyperlink.js: Added.
     19        (runTest):
     20        * http/tests/quicklook/submit-form-blocked.html: Ditto.
     21        * http/tests/quicklook/top-navigation-blocked.html: Ditto.
     22        * platform/ios-simulator-wk1/TestExpectations: Unskip QuickLook tests as we can now run
     23        them in an Apple Internal build of DumpRenderTree. Note that these test are listed in
     24        file LayoutTests/platform/ios-simulator/TestExpectations so that they are skipped in
     25        WebKit for iOS Simulator built with the public iOS SDK as we need to fix <https://bugs.webkit.org/show_bug.cgi?id=141906>.
     26        * platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt: Added.
     27        For some reason the console message "Unsafe JavaScript attempt to initiate navigation" includes
     28        a line number in DumpRenderTree (why?). This line number is not emitted when the test is run
     29        in WebKitTestRunner. Add platform-specific result for now.
     30
    1312017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
    232
  • trunk/LayoutTests/http/tests/quicklook/at-import-stylesheet-blocked.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
    78    testRunner.dumpAsText();
    89    testRunner.dumpChildFramesAsText();
    9     testRunner.waitUntilDone();
    1010}
    1111</script>
    1212</head>
    1313<body>
    14 <iframe src="resources/at-import-stylesheet-blocked.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     14<iframe src="resources/at-import-stylesheet-blocked.docx" onload="runTest(this)"></iframe>
    1515</body>
    1616</html>
  • trunk/LayoutTests/http/tests/quicklook/base-url-blocked.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    6 if (window.testRunner) {
     7if (window.testRunner)
    78    testRunner.dumpAsText();
    8     testRunner.waitUntilDone();
    9 }
    109</script>
    1110</head>
    1211<body>
    1312<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>
    14 <iframe src="resources/base-url-blocked.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     13<iframe src="resources/base-url-blocked.docx" onload="runTest(this)"></iframe>
    1514</body>
    1615</html>
  • trunk/LayoutTests/http/tests/quicklook/cross-origin-iframe-blocked.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
    78    testRunner.dumpAsText();
    89    testRunner.dumpChildFramesAsText();
    9     testRunner.waitUntilDone();
    1010}
    1111</script>
     
    1313<body>
    1414<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>
    15 <iframe src="resources/cross-origin-iframe-blocked.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     15<iframe src="resources/cross-origin-iframe-blocked.docx" onload="runTest(this)"></iframe>
    1616</body>
    1717</html>
  • trunk/LayoutTests/http/tests/quicklook/document-domain-is-empty-string.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
    78    testRunner.dumpAsText();
    89    testRunner.dumpChildFramesAsText();
    9     testRunner.waitUntilDone();
    1010}
    1111</script>
    1212</head>
    1313<body>
    14 <iframe src="resources/document-domain-is-empty-string.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     14<iframe src="resources/document-domain-is-empty-string.docx" onload="runTest(this)"></iframe>
    1515</body>
    1616</html>
  • trunk/LayoutTests/http/tests/quicklook/external-stylesheet-blocked.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
    78    testRunner.dumpAsText();
    89    testRunner.dumpChildFramesAsText();
    9     testRunner.waitUntilDone();
    1010}
    1111</script>
    1212</head>
    1313<body>
    14 <iframe src="resources/external-stylesheet-blocked.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     14<iframe src="resources/external-stylesheet-blocked.docx" onload="runTest(this)"></iframe>
    1515</body>
    1616</html>
  • trunk/LayoutTests/http/tests/quicklook/hide-referer-on-navigation.html

    r210022 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    6 function doTest(){
    7     tapAtPointAndNotifyDone(document.getElementsByTagName('iframe')[0].offsetLeft + 5, document.getElementsByTagName('iframe')[0].offsetTop + 5)
    8 }
    9 
    107if (window.testRunner) {
    118    testRunner.dumpAsText();
    129    testRunner.dumpChildFramesAsText();
    13     testRunner.waitUntilDone();
    1410}
    1511</script>
    1612</head>
    17 <body onload="doTest()">
     13<body onload="runTest(document.querySelector('iframe'))">
    1814<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>
    1915
  • trunk/LayoutTests/http/tests/quicklook/rtf-document-domain-is-empty-string.html

    r211250 r211373  
    33<head>
    44<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
     
    89    testRunner.dumpChildFramesAsText();
    910}
    10 
    11 function runTest(frame)
    12 {
    13     if (!window.testRunner)
    14         return;
    15 
    16     // FIXME: For some reason the (x, y) coordinates of the hyperlink "Run test" is offset 2 pixels
    17     // in legacy WebKit (why?).
    18     var fudgeFactor = UIHelper.isWebKit2() ? 0 : 2;
    19     UIHelper.wait(UIHelper.activateAt(frame.offsetLeft + 8 + fudgeFactor, frame.offsetTop + 8 + fudgeFactor));
    20 }
    2111</script>
    2212</head>
    2313<body>
    24 <iframe src="resources/document-domain-is-empty-string.rtf" onload="runTest(this)"></iframe>
     14<iframe src="resources/document-domain-is-empty-string.rtf" onload="runTest(this, 8 /* offsetInFrame */)"></iframe>
    2515</body>
    2616</html>
  • trunk/LayoutTests/http/tests/quicklook/submit-form-blocked.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
    78    testRunner.dumpAsText();
    8     testRunner.waitUntilDone();
    99}
    1010</script>
     
    1212<body>
    1313<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>
    14 <iframe src="resources/submit-form-blocked.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     14<iframe src="resources/submit-form-blocked.docx" onload="runTest(this)"></iframe>
    1515</body>
    1616</html>
  • trunk/LayoutTests/http/tests/quicklook/top-navigation-blocked.html

    r207155 r211373  
    22<html>
    33<head>
    4 <script src="resources/tap-at-point-and-notify-done.js"></script>
     4<script src="/js-test-resources/ui-helper.js"></script>
     5<script src="resources/tap-run-test-hyperlink.js"></script>
    56<script>
    67if (window.testRunner) {
    78    testRunner.dumpAsText();
    89    testRunner.dumpChildFramesAsText();
    9     testRunner.waitUntilDone();
    1010}
    1111</script>
    1212</head>
    1313<body>
    14 <iframe src="resources/top-navigation-blocked.docx" onload="tapAtPointAndNotifyDone(this.offsetLeft + 5, this.offsetTop + 5)"></iframe>
     14<iframe src="resources/top-navigation-blocked.docx" onload="runTest(this)"></iframe>
    1515</body>
    1616</html>
  • trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations

    r211095 r211373  
    22#
    33# See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
    4 
    5 # FIXME: uiController.singleTapAtPoint() is not implemented in DumpRenderTree. And
    6 # we cannot write these tests in terms of EventSender without identifying which
    7 # test tool is being used to run the test, which is not straightforward at the time
    8 # of writing (10/07/2016).
    9 http/tests/quicklook/at-import-stylesheet-blocked.html
    10 http/tests/quicklook/base-url-blocked.html
    11 http/tests/quicklook/cross-origin-iframe-blocked.html
    12 http/tests/quicklook/document-domain-is-empty-string.html
    13 http/tests/quicklook/external-stylesheet-blocked.html
    14 http/tests/quicklook/hide-referer-on-navigation.html
    15 http/tests/quicklook/resources/fail.html
    16 http/tests/quicklook/submit-form-blocked.html
    17 http/tests/quicklook/top-navigation-blocked.html
    184
    195# Selectively re-enable viewport tests that work
Note: See TracChangeset for help on using the changeset viewer.