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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto.html

Issue 2452073002: Freeze global prototype chain per WebIDL (Closed)
Patch Set: Test improvements Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="/js-test-resources/js-test.js"></script>
4 </head>
5 <body>
6 <iframe src="http://localhost:8000/" style=""></iframe>
7 <pre id="console"></pre>
8 <script>
9 window.jsTestIsAsync = true;
10
11 description("Tests that making other frame window a prototype doesn't expose that window methods");
12
13 targetWindow = frames[0];
14
15 wasInvoked = false;
16
17 function callback(global) {
18 global.wasInvoked = true;
19 }
20
21 function check() {
22 shouldBeFalse('this.wasInvoked');
23 finishJSTest();
24 }
25
26 var originalSetTimeout = setTimeout;
27 window.onload = function() {
28 __proto__ = targetWindow;
29
30 shouldThrow('targetWindow.setTimeout(callback, 0, this);', '"SecurityError : Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross -origin frame."');
31 shouldThrow('setTimeout.call(targetWindow, callback, 0, this);', '"Securit yError: Failed to execute \'setTimeout\' on \'Window\': Blocked a frame with ori gin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."');
32 shouldThrow('originalSetTimeout.call(targetWindow, callback, 0, this);', ' "SecurityError: Failed to execute \'setTimeout\' on \'Window\': Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."');
33
34 originalSetTimeout(check, 10);
35 }
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698