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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated.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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/window-property-collector.js"></script> 4 <script src="resources/window-property-collector.js"></script>
5 <script> 5 <script>
6 var jsTestIsAsync = true; 6 var jsTestIsAsync = true;
7 7
8 var frame; 8 var frame;
9 var oldChildWindow; 9 var oldChildWindow;
10 var newChildWindow; 10 var newChildWindow;
11 var propertiesToVerify = []; 11 var propertiesToVerify = [];
12 12
13 function insertExpectedResult(path, expected) 13 function insertExpectedResult(path, expected)
14 { 14 {
15 var propertyPath = path.join('.'); 15 var propertyPath = path.join('.');
16 propertiesToVerify.push({'property': "oldChildWindow." + propertyPath, 'expe cted': "newChildWindow." + propertyPath}); 16 propertiesToVerify.push({'property': "oldChildWindow." + propertyPath, 'expe cted': "newChildWindow." + propertyPath});
17 } 17 }
18 18
19 function runTest() 19 function runTest()
20 { 20 {
21 frame = document.getElementById("test_frame"); 21 frame = document.getElementById("test_frame");
22 description("Tests property access on a cached DOMWindow after the associate d frame is navigated. Test should not crash and properties read from the cached DOMWindow should be identical to properties through the 'current' DOMWindow."); 22 description("Tests property access on a cached DOMWindow after the associate d frame is navigated. Test should not crash and properties read from the cached DOMWindow should be identical to properties through the 'current' DOMWindow.");
23 oldChildWindow = frame.contentWindow; 23 oldChildWindow = frame.contentWindow;
24 // Have expected results assume that the frame hasn't been closed (=> window .closed = false.) 24 // Have expected results assume that the frame hasn't been closed (=> window .closed = false.)
25 collectProperties(document.getElementById("src_frame").contentWindow, false) ; 25 collectProperties(document.getElementById("src_frame").contentWindow, false) ;
26 frame.onload = testFrameLoaded;
26 frame.src = 'about:blank'; 27 frame.src = 'about:blank';
27 } 28 }
28 29
29 function testFrameLoaded() 30 function testFrameLoaded()
30 { 31 {
31 if (frame) { 32 if (frame) {
32 newChildWindow = frame.contentWindow; 33 newChildWindow = frame.contentWindow;
33 for (var i = 0; i < propertiesToVerify.length; ++i) 34 for (var i = 0; i < propertiesToVerify.length; ++i)
34 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expec ted); 35 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expec ted);
35 finishJSTest(); 36 finishJSTest();
36 } 37 }
37 } 38 }
38 </script> 39 </script>
39 </head> 40 </head>
40 <body onload="runTest()"> 41 <body onload="runTest()">
41 <iframe id="src_frame"></iframe> 42 <iframe id="src_frame"></iframe>
42 <iframe id="test_frame" src="resources/blank.html" onload="testFrameLoaded()"></ iframe> 43 <iframe id="test_frame" src="data:text/plain,"></iframe>
43 </body> 44 </body>
44 </html> 45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698