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

Side by Side Diff: LayoutTests/http/tests/security/resources/cross-frame-access.js

Issue 19095003: Throw 'SecurityError' upon cross-origin Location access. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. 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 function log(s) 1 function log(s)
2 { 2 {
3 document.getElementById("console").appendChild(document.createTextNode(s + " \n")); 3 document.getElementById("console").appendChild(document.createTextNode(s + " \n"));
4 } 4 }
5 5
6 function shouldBe(a, b, shouldNotPrintValues) 6 function shouldBe(a, b, shouldNotPrintValues)
7 { 7 {
8 var evalA, evalB; 8 var evalA, evalB;
9 try { 9 try {
10 evalA = eval(a); 10 evalA = eval(a);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 function canGet(keyPath) 52 function canGet(keyPath)
53 { 53 {
54 try { 54 try {
55 return eval("window." + keyPath) !== undefined; 55 return eval("window." + keyPath) !== undefined;
56 } catch(e) { 56 } catch(e) {
57 return false; 57 return false;
58 } 58 }
59 } 59 }
60 60
61 function accessThrowsException(keyPath) {
62 try {
63 eval("window." + keyPath);
64 return false;
65 } catch (e) {
66 return true;
67 }
68 }
69
70 function deletionThrowsException(keyPath) {
71 try {
72 eval("delete " + keyPath);
73 return false;
74 } catch (e) {
75 return true;
76 }
77 }
78
61 function canGetDescriptor(target, property) 79 function canGetDescriptor(target, property)
62 { 80 {
63 try { 81 try {
64 var desc = Object.getOwnPropertyDescriptor(target, property); 82 var desc = Object.getOwnPropertyDescriptor(target, property);
65 // To deal with an idiosyncrasy in how binding objects work in conjuncti on with 83 // To deal with an idiosyncrasy in how binding objects work in conjuncti on with
66 // slot and descriptor delegates we also allow descriptor with undefined value/getter/setter 84 // slot and descriptor delegates we also allow descriptor with undefined value/getter/setter
67 return desc !== undefined && (desc.value !== undefined || desc.get !== undefined || desc.set !== undefined); 85 return desc !== undefined && (desc.value !== undefined || desc.get !== undefined || desc.set !== undefined);
68 } catch(e) { 86 } catch(e) {
69 return false; 87 return false;
70 } 88 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 function doneHandler() { 218 function doneHandler() {
201 if (win.closed) { 219 if (win.closed) {
202 if (window.testRunner) 220 if (window.testRunner)
203 testRunner.notifyDone(); 221 testRunner.notifyDone();
204 return; 222 return;
205 } 223 }
206 224
207 setTimeout(doneHandler, 5); 225 setTimeout(doneHandler, 5);
208 } 226 }
209 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698