OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="/js-test-resources/js-test.js"></script> | 3 <script src="/js-test-resources/js-test.js"></script> |
4 <script src="resources/cross-frame-access.js"></script> | 4 <script src="resources/cross-frame-access.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get
-test.html" style=""></iframe> | 7 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get
-test.html" style=""></iframe> |
8 <pre id="console"></pre> | 8 <pre id="console"></pre> |
9 <script> | 9 <script> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // void focus(); | 22 // void focus(); |
23 // void blur(); | 23 // void blur(); |
24 // void close(); | 24 // void close(); |
25 // void postMessage(in DOMString message); | 25 // void postMessage(in DOMString message); |
26 | 26 |
27 // - Tests for the Window object - | 27 // - Tests for the Window object - |
28 shouldThrow("window.setTimeout.call(targetWindow, 'void(0);', 0)", '"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."'); | 28 shouldThrow("window.setTimeout.call(targetWindow, 'void(0);', 0)", '"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."'); |
29 shouldThrow("window.setInterval.call(targetWindow, 'void(0);', 0)", '"Securi
tyError: Failed to execute \'setInterval\' on \'Window\': Blocked a frame with o
rigin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); | 29 shouldThrow("window.setInterval.call(targetWindow, 'void(0);', 0)", '"Securi
tyError: Failed to execute \'setInterval\' on \'Window\': Blocked a frame with o
rigin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
30 shouldThrow("window.showModalDialog.call(targetWindow);", '"SecurityError: F
ailed to execute \'showModalDialog\' on \'Window\': Blocked a frame with origin
\\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); | 30 shouldThrow("window.showModalDialog.call(targetWindow);", '"SecurityError: F
ailed to execute \'showModalDialog\' on \'Window\': Blocked a frame with origin
\\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
31 shouldThrow("window.open.call(targetWindow, '')", '"SecurityError: Failed to
execute \'open\' on \'Window\': Blocked a frame with origin \\"http://127.0.0.1
:8000\\" from accessing a cross-origin frame."'); | 31 shouldThrow("window.open.call(targetWindow, '')", '"SecurityError: Failed to
execute \'open\' on \'Window\': Blocked a frame with origin \\"http://127.0.0.1
:8000\\" from accessing a cross-origin frame."'); |
32 shouldThrow("window.getSelection.call(targetWindow)", '"SecurityError: Block
ed a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin
frame."'); | 32 shouldThrow("window.getSelection.call(targetWindow)", '"SecurityError: Faile
d to execute \'getSelection\' on \'Window\': Blocked a frame with origin \\"http
://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
33 shouldThrow("window.find.call(targetWindow, 'string', false, false, false, f
alse, false, false)", '"SecurityError: Blocked a frame with origin \\"http://127
.0.0.1:8000\\" from accessing a cross-origin frame."'); | 33 shouldThrow("window.find.call(targetWindow, 'string', false, false, false, f
alse, false, false)", '"SecurityError: Failed to execute \'find\' on \'Window\':
Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-
origin frame."'); |
34 shouldThrow("window.confirm.call(targetWindow, 'message')", '"SecurityError:
Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-
origin frame."'); | 34 shouldThrow("window.confirm.call(targetWindow, 'message')", '"SecurityError:
Failed to execute \'confirm\' on \'Window\': Blocked a frame with origin \\"htt
p://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
35 shouldThrow("window.prompt.call(targetWindow, 'message', 'defaultValue')", '
"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000\\" from acc
essing a cross-origin frame."'); | 35 shouldThrow("window.prompt.call(targetWindow, 'message', 'defaultValue')", '
"SecurityError: Failed to execute \'prompt\' on \'Window\': Blocked a frame with
origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
36 shouldThrow("window.getComputedStyle.call(targetWindow, document.body, '')",
'"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000\\" from a
ccessing a cross-origin frame."'); | 36 shouldThrow("window.getComputedStyle.call(targetWindow, document.body, '')",
'"SecurityError: Failed to execute \'getComputedStyle\' on \'Window\': Blocked
a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin fr
ame."'); |
37 shouldThrow("window.getMatchedCSSRules.call(targetWindow, document.body, '')
", '"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000\\" from
accessing a cross-origin frame."'); | 37 shouldThrow("window.getMatchedCSSRules.call(targetWindow, document.body, '')
", '"SecurityError: Failed to execute \'getMatchedCSSRules\' on \'Window\': Bloc
ked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origi
n frame."'); |
38 shouldThrow("window.openDatabase.call(targetWindow, 'name', '1.0', 'descript
ion', 0)", '"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000
\\" from accessing a cross-origin frame."'); | 38 shouldThrow("window.openDatabase.call(targetWindow, 'name', '1.0', 'descript
ion', 0)", '"SecurityError: Failed to execute \'openDatabase\' on \'Window\': Bl
ocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-ori
gin frame."'); |
39 shouldThrow("window.atob.call(targetWindow, 'string')", '"SecurityError: Blo
cked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-orig
in frame."'); | 39 shouldThrow("window.atob.call(targetWindow, 'string')", '"SecurityError: Fai
led to execute \'atob\' on \'Window\': Blocked a frame with origin \\"http://127
.0.0.1:8000\\" from accessing a cross-origin frame."'); |
40 shouldThrow("window.btoa.call(targetWindow, 'string')", '"SecurityError: Blo
cked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-orig
in frame."'); | 40 shouldThrow("window.btoa.call(targetWindow, 'string')", '"SecurityError: Fai
led to execute \'btoa\' on \'Window\': Blocked a frame with origin \\"http://127
.0.0.1:8000\\" from accessing a cross-origin frame."'); |
41 shouldThrow("window.clearTimeout.call(targetWindow, 0);", '"SecurityError: B
locked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-or
igin frame."'); | 41 shouldThrow("window.clearTimeout.call(targetWindow, 0);", '"SecurityError: F
ailed to execute \'clearTimeout\' on \'Window\': Blocked a frame with origin \\"
http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
42 shouldThrow("window.clearInterval.call(targetWindow, 0);", '"SecurityError:
Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-o
rigin frame."'); | 42 shouldThrow("window.clearInterval.call(targetWindow, 0);", '"SecurityError:
Failed to execute \'clearInterval\' on \'Window\': Blocked a frame with origin \
\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
43 shouldThrow("window.print.call(targetWindow);", '"SecurityError: Blocked a f
rame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame
."'); | 43 shouldThrow("window.print.call(targetWindow);", '"SecurityError: Failed to e
xecute \'print\' on \'Window\': Blocked a frame with origin \\"http://127.0.0.1:
8000\\" from accessing a cross-origin frame."'); |
44 shouldThrow("window.stop.call(targetWindow);", '"SecurityError: Blocked a fr
ame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame.
"'); | 44 shouldThrow("window.stop.call(targetWindow);", '"SecurityError: Failed to ex
ecute \'stop\' on \'Window\': Blocked a frame with origin \\"http://127.0.0.1:80
00\\" from accessing a cross-origin frame."'); |
45 shouldThrow("window.alert.call(targetWindow, 'message');", '"SecurityError:
Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-o
rigin frame."'); | 45 shouldThrow("window.alert.call(targetWindow, 'message');", '"SecurityError:
Failed to execute \'alert\' on \'Window\': Blocked a frame with origin \\"http:/
/127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
46 shouldThrow("window.scrollBy.call(targetWindow, 0, 0);", '"SecurityError: Bl
ocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-ori
gin frame."'); | 46 shouldThrow("window.scrollBy.call(targetWindow, 0, 0);", '"SecurityError: Fa
iled to execute \'scrollBy\' on \'Window\': Blocked a frame with origin \\"http:
//127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
47 shouldThrow("window.scrollTo.call(targetWindow, 0, 0);", '"SecurityError: Bl
ocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-ori
gin frame."'); | 47 shouldThrow("window.scrollTo.call(targetWindow, 0, 0);", '"SecurityError: Fa
iled to execute \'scrollTo\' on \'Window\': Blocked a frame with origin \\"http:
//127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
48 shouldThrow("window.scroll.call(targetWindow, 0, 0);", '"SecurityError: Bloc
ked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origi
n frame."'); | 48 shouldThrow("window.scroll.call(targetWindow, 0, 0);", '"SecurityError: Fail
ed to execute \'scroll\' on \'Window\': Blocked a frame with origin \\"http://12
7.0.0.1:8000\\" from accessing a cross-origin frame."'); |
49 shouldThrow("window.moveBy.call(targetWindow, 0, 0);", '"SecurityError: Bloc
ked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origi
n frame."'); | 49 shouldThrow("window.moveBy.call(targetWindow, 0, 0);", '"SecurityError: Fail
ed to execute \'moveBy\' on \'Window\': Blocked a frame with origin \\"http://12
7.0.0.1:8000\\" from accessing a cross-origin frame."'); |
50 shouldThrow("window.moveTo.call(targetWindow, 0, 0);", '"SecurityError: Bloc
ked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origi
n frame."'); | 50 shouldThrow("window.moveTo.call(targetWindow, 0, 0);", '"SecurityError: Fail
ed to execute \'moveTo\' on \'Window\': Blocked a frame with origin \\"http://12
7.0.0.1:8000\\" from accessing a cross-origin frame."'); |
51 shouldThrow("window.resizeBy.call(targetWindow, 0, 0);", '"SecurityError: Bl
ocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-ori
gin frame."'); | 51 shouldThrow("window.resizeBy.call(targetWindow, 0, 0);", '"SecurityError: Fa
iled to execute \'resizeBy\' on \'Window\': Blocked a frame with origin \\"http:
//127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
52 shouldThrow("window.resizeTo.call(targetWindow, 0, 0);", '"SecurityError: Bl
ocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-ori
gin frame."'); | 52 shouldThrow("window.resizeTo.call(targetWindow, 0, 0);", '"SecurityError: Fa
iled to execute \'resizeTo\' on \'Window\': Blocked a frame with origin \\"http:
//127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
53 shouldThrow("window.addEventListener.call(targetWindow, 'load', null, false)
;", '"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000\\" fro
m accessing a cross-origin frame."'); | 53 shouldThrow("window.addEventListener.call(targetWindow, 'load', null, false)
;", '"SecurityError: Failed to execute \'addEventListener\' on \'EventTarget\':
Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-o
rigin frame."'); |
54 shouldThrow("window.removeEventListener.call(targetWindow, 'load', null, fal
se);", '"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000\\"
from accessing a cross-origin frame."'); | 54 shouldThrow("window.removeEventListener.call(targetWindow, 'load', null, fal
se);", '"SecurityError: Failed to execute \'removeEventListener\' on \'EventTarg
et\': Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a c
ross-origin frame."'); |
55 | 55 |
56 // Throws an EvalError and logs to the error console | 56 // Throws an EvalError and logs to the error console |
57 shouldBe("window.eval.call(targetWindow, '1+2');", '3'); | 57 shouldBe("window.eval.call(targetWindow, '1+2');", '3'); |
58 | 58 |
59 // - Tests for the Location object - | 59 // - Tests for the Location object - |
60 shouldThrow("window.location.toString.call(targetWindow.location)", '"Securi
tyError: Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing
a cross-origin frame."'); | 60 shouldThrow("window.location.toString.call(targetWindow.location)", '"Securi
tyError: Failed to execute \'toString\' on \'Location\': Blocked a frame with or
igin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."'); |
61 | 61 |
62 // Work around DRT bug that causes subsequent tests to fail. | 62 // Work around DRT bug that causes subsequent tests to fail. |
63 window.stop(); | 63 window.stop(); |
64 finishJSTest(); | 64 finishJSTest(); |
65 } | 65 } |
66 </script> | 66 </script> |
67 </body> | 67 </body> |
68 </html> | 68 </html> |
OLD | NEW |