Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/security/detached-cross-frame-access.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/detached-cross-frame-access.html b/third_party/WebKit/LayoutTests/http/tests/security/detached-cross-frame-access.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f0ef2113a640c4ae1989082e8ec6868a60cf923e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/detached-cross-frame-access.html |
| @@ -0,0 +1,28 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +<script> |
| +var accessTest = async_test("Test cross-origin access on a detached window"); |
| +window.onload = accessTest.step_func(function () { |
| + var detachedWindow = window[0]; |
| + document.querySelector('iframe').remove(); |
| + test(function() { |
| + assert_throws("SecurityError", function () { |
| + window.requestAnimationFrame.call(detachedWindow, function () { }); |
| + }); |
| + }, "method call with detached window receiver"); |
| + test(function() { |
|
dcheng
2017/02/19 09:05:51
This is a bit unsatisfactory, but otherwise, the t
|
| + assert_throws("SecurityError", function () { |
| + Object.getOwnPropertyDescriptor(window, "document").get.call(detachedWindow); |
| + }); |
| + }, "attribute access with detached window receiver"); |
| + accessTest.done(); |
| +}); |
| +</script> |
| +</head> |
| +<body> |
| +<iframe src="http://localhost:8000/http/tests/security/resources/blank.html"></iframe> |
| +</body> |
| +</html> |