Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access.html

Issue 2706923002: Rework security checks to be based on Window rather than Frame. (Closed)
Patch Set: Do not hardcode V8Window::wrapperTypeInfo Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access.html b/third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access.html
new file mode 100644
index 0000000000000000000000000000000000000000..cf64b84f4fa2d6c5d1f12929f7f7581d98bc7f7e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test("Test that cross-origin access on a detached window throws a SecurityError.");
+window.onload = t.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 should throw");
+ test(function() {
+ assert_throws("SecurityError", function () {
+ Object.getOwnPropertyDescriptor(window, "document").get.call(detachedWindow);
+ });
+ }, "attribute access with detached window receiver should throw");
+ t.done();
+});
+</script>
+</head>
+<body>
+<iframe src="data:text/html,"></iframe>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698