Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access.html b/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access.html |
| index 1a0ec1bdbf6cde672c173c5520e835b0fbcfc853..3d2c234b934471056898936b1c5a741e5dfeaacf 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access.html |
| +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access.html |
| @@ -2,33 +2,27 @@ |
| <html> |
| <head> |
| <title>Null frame access tests</title> |
| -<script src="../../../resources/js-test.js"></script> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| <script> |
| -description("This tests access to a window with a null frame. You should see \"PASS\" for each of the three tests below."); |
| +var t = async_test('This tests access to a window with a null frame.'); |
| -window.jsTestIsAsync = true; |
| -window.onload = function() { |
| - if (window.testRunner) { |
| - testRunner.dumpAsText(); |
| - testRunner.waitUntilDone(); |
| - } |
| +window.onload = t.step_func(function () { |
| + var childWindow = window[0]; |
| + childWindow.frameElement.remove(); |
| + // Removing the owner element from the DOM should null the frame. In Blink, |
| + // this can be observed by checking childWindow.parent == null. |
| + assert_equals(childWindow.parent, null); |
| - var tag = document.getElementById('subframe'); |
| - var win = tag.contentWindow; |
| - // remove the element so the window has a null frame |
| - tag.parentNode.removeChild(tag); |
| - |
| - // schedule to run after the frame is null |
| - asyncGC(function() { |
| - debug("missing property: " + (win.test || 'PASS')) |
| - debug("missing array index: " + (win[20] || 'PASS')); |
| - debug("missing interface object: " + (win.Comment || 'PASS')); |
| - finishJSTest(); |
| - }); |
| -}; |
| + assert_equals(childWindow.test, 'abc', 'Named property should still be accessible.'); |
| + assert_equals(childWindow[20], '123', 'Indexed property should still be accessible.'); |
| + // TODO(dcheng): Why does this return null? |
| + assert_equals(childWindow.Comment, undefined, 'Interface Object should be gone.'); |
|
dcheng
2017/03/06 06:59:46
I don't understand this, btw... but that seems to
|
| + t.done(); |
| +}); |
| </script> |
| </head> |
| <body> |
| -<iframe id="subframe" src="data:text/html,<script>window.test='FAIL ... ';window[20]='FAIL ... ';</script>" /> |
| +<iframe id="subframe" src="data:text/html,<script>window.test='abc';window[20]='123';</script>" /> |
| </body> |
| </html> |