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

Side by Side Diff: LayoutTests/http/tests/security/inactive-document-with-empty-security-origin.html

Issue 19932002: Throw exceptions on all failed cross-origin access checks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <script> 1 <script>
2 (function() { 2 (function() {
3 3
4 if (location.hash == "#stop") 4 if (location.hash == "#stop")
5 return; 5 return;
6 6
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 testRunner.waitUntilDone(); 9 testRunner.waitUntilDone();
10 testRunner.setCanOpenWindows(); 10 testRunner.setCanOpenWindows();
11 testRunner.setCloseRemainingWindowsWhenComplete(true); 11 testRunner.setCloseRemainingWindowsWhenComplete(true);
12 } 12 }
13 13
14 blankWindow = open(location + "#stop"); 14 blankWindow = open(location + "#stop");
15 blankWindow.onload = function() { 15 blankWindow.onload = function() {
16 blankFunc = blankWindow.Function; 16 blankFunc = blankWindow.Function;
17 blankWindow.opener = null; 17 blankWindow.opener = null;
18 blankWindow.eval("location = 'about:blank'"); 18 blankWindow.eval("location = 'about:blank'");
19 19
20 setTimeout(function() { 20 setTimeout(function() {
21 blankFunc = blankFunc("return window.Function")(); 21 try {
22 blankFunc = blankFunc("return window.Function")();
23 } catch (e) {
24 blankFunc = false;
25 }
22 if (!blankFunc && window.testRunner) { 26 if (!blankFunc && window.testRunner) {
23 testRunner.notifyDone() 27 testRunner.notifyDone()
24 return; 28 return;
25 } 29 }
26 blankFunc("alertFunc", "(" + function() { 30 blankFunc("alertFunc", "(" + function() {
27 targetWindow = open("http://localhost:8080/security/resources/post-d one-to-opener.html"); 31 targetWindow = open("http://localhost:8080/security/resources/post-d one-to-opener.html");
28 targetFunc = targetWindow.Function; 32 targetFunc = targetWindow.Function;
29 this.alertFunc = alertFunc; 33 this.alertFunc = alertFunc;
30 34
31 targetWindow.addEventListener("load", function() { 35 targetWindow.addEventListener("load", function() {
32 alertFunc(targetFunc("return document.documentElement.innerHTML" )()); 36 alertFunc(targetFunc("return document.documentElement.innerHTML" )());
33 }); 37 });
34 } + ")()")( function(s) { alert(s) }); 38 } + ")()")( function(s) { alert(s) });
35 }, 0); 39 }, 0);
36 } 40 }
37 41
38 window.addEventListener('message', function(evt) { 42 window.addEventListener('message', function(evt) {
39 if (evt.data == 'done') { 43 if (evt.data == 'done') {
40 if (window.testRunner) 44 if (window.testRunner)
41 testRunner.notifyDone(); 45 testRunner.notifyDone();
42 } 46 }
43 }); 47 });
44 48
45 })(); 49 })();
46 </script> 50 </script>
47 This test passes if it doesn't alert something ugly. 51 This test passes if it doesn't alert something ugly.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698