Changeset 202428 in webkit


Ignore:
Timestamp:
Jun 24, 2016 10:34:42 AM (8 years ago)
Author:
wilander@apple.com
Message:

Make window.open layout tests for about: URLs work on iOS
https://bugs.webkit.org/show_bug.cgi?id=159072

Reviewed by Alex Christensen.

Fix two window.open layout tests for iOS. They previously used click events.
Now they instead turn off the popup blocker and just call window.open() on
the load event.

  • http/tests/dom/window-open-about-blank-and-access-document-expected.txt:
  • http/tests/dom/window-open-about-blank-and-access-document.html:
  • http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt:
  • http/tests/dom/window-open-about-webkit-org-and-access-document.html:
  • platform/ios-simulator/TestExpectations:

Removed the skipping of these two test cases.

Location:
trunk/LayoutTests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202421 r202428  
     12016-06-24  John Wilander  <wilander@apple.com>
     2
     3        Make window.open layout tests for about: URLs work on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=159072
     5
     6        Reviewed by Alex Christensen.
     7
     8        Fix two window.open layout tests for iOS. They previously used click events.
     9        Now they instead turn off the popup blocker and just call window.open() on
     10        the load event.
     11
     12        * http/tests/dom/window-open-about-blank-and-access-document-expected.txt:
     13        * http/tests/dom/window-open-about-blank-and-access-document.html:
     14        * http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt:
     15        * http/tests/dom/window-open-about-webkit-org-and-access-document.html:
     16        * platform/ios-simulator/TestExpectations:
     17            Removed the skipping of these two test cases.
     18
    1192016-06-24  Yusuke Suzuki  <utatane.tea@gmail.com>
    220
  • trunk/LayoutTests/http/tests/dom/window-open-about-blank-and-access-document-expected.txt

    r202151 r202428  
    11CONSOLE MESSAGE: line 1: Injected script running.
    2 
    32PASS newWindow.document is defined.
    43
  • trunk/LayoutTests/http/tests/dom/window-open-about-blank-and-access-document.html

    r202151 r202428  
    1111            testRunner.setCanOpenWindows();
    1212            testRunner.waitUntilDone();
     13            testRunner.setPopupBlockingEnabled(false);
    1314        }
    1415
    15         function checkNewWindowDocumentIsUndefined () {
     16        function checkNewWindowDocumentIsDefined () {
    1617            shouldBeDefined("newWindow.document");
    1718            if (window.testRunner)
     
    1920        }
    2021
    21         function clickHandler() {
     22        function run() {
    2223            newWindow = window.open("about:blank");
    2324            try {
    2425                newWindow.document.write("<scri" + "pt>console.log('Injected script running.')</sc" + "ript>");
    25                 setTimeout(checkNewWindowDocumentIsUndefined, 500);
     26                setTimeout(checkNewWindowDocumentIsDefined, 500);
    2627            } catch (e) {
    2728                testFailed("Was not able to write to the new window's document.");
     
    3031            }
    3132        }
    32 
    33         function clickButton() {
    34             var button = document.getElementById("test");
    35             var buttonX = button.offsetLeft + button.offsetWidth / 2;
    36             var buttonY = button.offsetTop + button.offsetHeight / 2;
    37             if (window.eventSender) {
    38                 eventSender.mouseMoveTo(buttonX, buttonY);
    39                 eventSender.mouseDown();
    40                 eventSender.mouseUp();
    41             }
    42         }
    4333    </script>
    4434</head>
    45 <body onload="clickButton()">
    46 <button id="test" onclick="clickHandler()"></button>
     35<body onload="run()">
    4736<div id="console"></div>
    4837</body>
  • trunk/LayoutTests/http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt

    r202151 r202428  
    1 CONSOLE MESSAGE: line 45: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "null".  The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "about". Protocols must match.
     1CONSOLE MESSAGE: line 34: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "null".  The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "about". Protocols must match.
    22
    33CONSOLE MESSAGE: line 347: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "null".  The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "about". Protocols must match.
    44
    5 
    65PASS newWindow.document is undefined.
    76
  • trunk/LayoutTests/http/tests/dom/window-open-about-webkit-org-and-access-document.html

    r202151 r202428  
    1010            testRunner.setCanOpenWindows();
    1111            testRunner.waitUntilDone();
     12            testRunner.setPopupBlockingEnabled(false);
    1213        }
    1314
     
    1819        }
    1920
    20         function clickHandler() {
     21        function run() {
    2122            newWindow = window.open("about://webkit.org");
    2223            try {
     
    2930            }
    3031        }
    31 
    32         function clickButton() {
    33             var button = document.getElementById("test");
    34             var buttonX = button.offsetLeft + button.offsetWidth / 2;
    35             var buttonY = button.offsetTop + button.offsetHeight / 2;
    36             if (window.eventSender) {
    37                 eventSender.mouseMoveTo(buttonX, buttonY);
    38                 eventSender.mouseDown();
    39                 eventSender.mouseUp();
    40             }
    41         }
    4232    </script>
    4333</head>
    44 <body onload="clickButton()">
    45 <button id="test" onclick="clickHandler()"></button>
     34<body onload="run()">
    4635<div id="console"></div>
    4736</body>
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r202420 r202428  
    255255fast/events/prevent-default-prevents-interaction-with-scrollbars.html [ Skip ]
    256256fast/text/text-disappear-on-deselect.html [ ImageOnlyFailure ]
    257 http/tests/dom/window-open-about-blank-and-access-document.html [ Skip ]
    258 http/tests/dom/window-open-about-webkit-org-and-access-document.html [ Skip ]
    259257
    260258webkit.org/b/148695 fast/shadow-dom [ Pass ]
Note: See TracChangeset for help on using the changeset viewer.