Changeset 229371 in webkit


Ignore:
Timestamp:
Mar 7, 2018 10:53:21 AM (6 years ago)
Author:
Chris Dumez
Message:

http/tests/misc/location-replace-crossdomain.html is failing with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183408

Reviewed by Alex Christensen.

The test was trying to navigate a cross-origin iframe via location.replace() and checking
that the load succeeded in a setTimeout(1). There is no guarantee that the frame has loaded
by that point. We would normally rely on the 'load' event but it is not feasible here since
the iframe is cross-origin. Instead, I opted to have the iframe to a page that posts a
message to its parent window to indicate that the load has succeeded.

  • http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt: Added.
  • http/tests/misc/location-replace-crossdomain-async-delegates.html: Added.
  • http/tests/misc/location-replace-crossdomain-expected.txt: Added.
  • http/tests/misc/location-replace-crossdomain.html:
  • platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
  • platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
  • platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
  • platform/win/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
Location:
trunk/LayoutTests
Files:
3 added
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r229370 r229371  
     12018-03-07  Chris Dumez  <cdumez@apple.com>
     2
     3        http/tests/misc/location-replace-crossdomain.html is failing with async policy delegates
     4        https://bugs.webkit.org/show_bug.cgi?id=183408
     5
     6        Reviewed by Alex Christensen.
     7
     8        The test was trying to navigate a cross-origin iframe via location.replace() and checking
     9        that the load succeeded in a setTimeout(1). There is no guarantee that the frame has loaded
     10        by that point. We would normally rely on the 'load' event but it is not feasible here since
     11        the iframe is cross-origin. Instead, I opted to have the iframe to a page that posts a
     12        message to its parent window to indicate that the load has succeeded.
     13
     14        * http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt: Added.
     15        * http/tests/misc/location-replace-crossdomain-async-delegates.html: Added.
     16        * http/tests/misc/location-replace-crossdomain-expected.txt: Added.
     17        * http/tests/misc/location-replace-crossdomain.html:
     18        * platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
     19        * platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
     20        * platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
     21        * platform/win/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
     22
    1232018-03-07  Per Arne Vollan  <pvollan@apple.com>
    224
  • trunk/LayoutTests/http/tests/misc/location-replace-crossdomain.html

    r191652 r229371  
     1<!DOCTYPE html>
    12<html>
    2 <head>
     3<body>
     4<script src="/js-test-resources/js-test.js"></script>
    35<script>
    4 function test()
    5 {   
    6     window.frames['crossDomainFrame'].location.replace("http://127.0.0.1:8000/misc/resources/success.html");
    7     if (window.testRunner)
    8         setTimeout("testRunner.notifyDone()", 1);
     6description("Checks that a cross origin iframe can be navigated using location.replace().");
     7jsTestIsAsync = true;
     8
     9onload = function()
     10{
     11    addEventListener("message", function() {
     12        testPassed("Navigated cross-origin frame via Location.replace");
     13        shouldBeEqualToString("window.frames['crossDomainFrame'].location.href", "http://127.0.0.1:8000/security/resources/postMessage.html");
     14        finishJSTest();
     15    });
     16    window.frames['crossDomainFrame'].location.replace("http://127.0.0.1:8000/security/resources/postMessage.html");
     17    setTimeout(function() {
     18        testFailed("Failed to navigate cross-origin frame via Location.replace");
     19        finishJSTest();
     20    }, 10000);
    921}
    10 
    11 if (window.testRunner)
    12     testRunner.waitUntilDone();
    13    
    1422</script>
    15 </head>
    16 <body onload="test();">
    1723<iframe id="crossDomainFrame" name="crossDomainFrame" src="http://localhost:8000/misc/resources/failure.html"></iframe>
    1824</body>
Note: See TracChangeset for help on using the changeset viewer.