⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284817 in webkit


Ignore:
Timestamp:
Oct 25, 2021, 12:30:14 PM (5 years ago)
Author:
Chris Dumez
Message:

Regression (r284610): [ iOS BigSur wk2 ] http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html is failing
https://bugs.webkit.org/show_bug.cgi?id=232151
<rdar://problem/84552682>

Unreviewed follow-up to r284723 since the test is still flaky on iOS.

  • TestExpectations:
  • http/tests/security/resources/anchor-tag-with-blank-target.html:
  • http/tests/security/resources/page-executing-javascript.html:
  • http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox-expected.txt:
  • http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html:
Location:
trunk/LayoutTests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r284800 r284817  
     12021-10-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression (r284610): [ iOS BigSur wk2 ] http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=232151
     5        <rdar://problem/84552682>
     6
     7        Unreviewed follow-up to r284723 since the test is still flaky on iOS.
     8
     9        * TestExpectations:
     10        * http/tests/security/resources/anchor-tag-with-blank-target.html:
     11        * http/tests/security/resources/page-executing-javascript.html:
     12        * http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox-expected.txt:
     13        * http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html:
     14
    1152021-10-25  Ayumi Kojima  <ayumi_kojima@apple.com>
    216
  • trunk/LayoutTests/TestExpectations

    r284782 r284817  
    410410
    411411# Console log lines may appear in a different order so we silence them.
     412http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html [ DumpJSConsoleLogInStdErr ]
    412413http/wpt/html/cross-origin-embedder-policy/require-corp.https.html [ DumpJSConsoleLogInStdErr ]
    413414imported/w3c/web-platform-tests/eventsource/format-utf-8.htm [ DumpJSConsoleLogInStdErr ]
  • trunk/LayoutTests/http/tests/security/resources/anchor-tag-with-blank-target.html

    r204266 r284817  
    44</head>
    55<body>
    6     <a id="theLink" target="_blank" href="./page-executing-javascript.html">_blank page that executes JavaScript</a>
     6    <a id="theLink" target="_blank" rel="opener" href="./page-executing-javascript.html">_blank page that executes JavaScript</a>
    77</body>
    88</html>
  • trunk/LayoutTests/http/tests/security/resources/page-executing-javascript.html

    r204266 r284817  
    55<p id="output"></p>
    66<script>
     7    opener.didRunScriptInPopup = true;
    78    document.getElementById("output").innerHTML = "Fail: JavaScript was allowed to execute.";
    89</script>
  • trunk/LayoutTests/http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox-expected.txt

    r204266 r284817  
    1 CONSOLE MESSAGE: Blocked script execution in 'http://127.0.0.1:8000/security/resources/page-executing-javascript.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
     1Tests that windows created from a sandboxed context inherit the same sandbox
    22
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     4
     5
     6PASS iframeContentWindow.didRunScriptInPopup is false
     7PASS successfullyParsed is true
     8
     9TEST COMPLETE
     10
  • trunk/LayoutTests/http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html

    r284723 r284817  
    33<head>
    44    <meta charset="UTF-8">
    5     <title>Tests that windows created from a sandboxed context inherit the same sandbox</title>
    6     <script src="../resources/js-test-pre.js"></script>
     5    <script src="/js-test-resources/js-test.js"></script>
    76</head>
    87<body>
    98<script>
    10     if (window.testRunner) {
    11         testRunner.waitUntilDone();
    12         testRunner.dumpAsText();
    13     }
    14 
    15     function wrapUp () {
    16         if (window.testRunner) {
    17             testRunner.notifyDone();
    18         }
    19     }
     9    description("Tests that windows created from a sandboxed context inherit the same sandbox");
     10    jsTestIsAsync = true;
    2011
    2112    function run() {
    22         var iframeContentDocument = document.getElementById("theIframe").contentDocument,
    23             theLink = iframeContentDocument.getElementById("theLink"),
    24             clickEvent = document.createEvent("HTMLEvents");
    25         clickEvent.initEvent("click", true, true);
    26         theLink.dispatchEvent(clickEvent);
     13        iframeContentWindow = document.getElementById("theIframe").contentWindow;
     14        iframeContentWindow.didRunScriptInPopup = false;
     15        let iframeContentDocument = document.getElementById("theIframe").contentDocument;
     16        iframeContentDocument.getElementById("theLink").click();
    2717
    28         var iframeContentWindow = document.getElementById("theIframe").contentWindow;
    29         if (iframeContentWindow.internals) {
    30             iframeContentWindow.internals.setConsoleMessageListener((msg) => {
    31                 setTimeout(wrapUp, 0);
    32             });
    33         } else
    34             setTimeout(wrapUp, 1000);
     18        setTimeout(() => {
     19            shouldBeFalse("iframeContentWindow.didRunScriptInPopup");
     20            finishJSTest();
     21        }, 500);
    3522    }
    3623</script>
Note: See TracChangeset for help on using the changeset viewer.