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

Side by Side Diff: LayoutTests/fast/frames/sandboxed-iframe-navigation-allowed.html

Issue 1040943002: When call getAttribute, HTMLIFrame.sandbox has a bug which don't return changed value. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modify a test-case for Layout Test. Created 5 years, 9 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> 4 <script>
5 5
6 if (window.testRunner) { 6 if (window.testRunner) {
7 window.testRunner.dumpAsText(); 7 window.testRunner.dumpAsText();
8 window.testRunner.waitUntilDone(); 8 window.testRunner.waitUntilDone();
9 } 9 }
10 10
11 function childFrameWasNavigated() 11 function childFrameWasNavigated()
12 { 12 {
13 // Check that the child frame was unable to load a plugin, since its parent is sandboxed. 13 // Check that the child frame was unable to load a plugin, since its parent is sandboxed.
14 shouldBeTrue("(self.sandboxedFrame.frameWithPlugin.document.getElementById(' plugin').destroyStream) == undefined"); 14 shouldBeTrue("(self.sandboxedFrame.frameWithPlugin.document.getElementById(' plugin').destroyStream) == undefined");
15 15
16 // Check a non-sandboxed frame as well, to ensure that the plugin is disable d by sandboxing 16 // Check a non-sandboxed frame as well, to ensure that the plugin is disable d by sandboxing
17 // and not some other failure 17 // and not some other failure
18 shouldBeTrue("(self.frameWithPlugin.document.getElementById('plugin').destro yStream) != undefined"); 18 shouldBeTrue("(self.frameWithPlugin.document.getElementById('plugin').destro yStream) != undefined");
19 19
20 // When the child frame (grandchild of the main window) has been navigated, 20 // When the child frame (grandchild of the main window) has been navigated,
21 // make the sandboxed frame navigate itself 21 // make the sandboxed frame navigate itself
22 self.sandboxedFrame.location.assign("javascript: top.sandboxWasNavigated();" ); 22 self.sandboxedFrame.location.assign("javascript: top.sandboxWasNavigated();" );
23 } 23 }
24 24
25 function sandboxWasNavigated() 25 function sandboxWasNavigated()
26 { 26 {
27 shouldBe("document.getElementById('sandboxedFrameId').sandbox", "['allow-scr ipts', 'allow-same-origin']"); 27 shouldBe("document.getElementById('sandboxedFrameId').sandbox", "['allow-scr ipts', 'allow-same-origin']");
28 shouldBe("document.getElementById('sandboxedFrameId').getAttribute('sandbox' )", "'allow-scripts allow-same-origin'");
28 isSuccessfullyParsed(); 29 isSuccessfullyParsed();
29 30
30 if (window.testRunner) 31 if (window.testRunner)
31 window.testRunner.notifyDone(); 32 window.testRunner.notifyDone();
32 } 33 }
33 34
34 </script> 35 </script>
35 </head> 36 </head>
36 37
37 <body> 38 <body>
38 39
39 <iframe sandbox="allow-scripts allow-same-origin" 40 <iframe sandbox="allow-scripts allow-same-origin"
40 name="sandboxedFrame" 41 name="sandboxedFrame"
41 id="sandboxedFrameId" 42 id="sandboxedFrameId"
42 src="resources/sandboxed-iframe-navigation-child.html"> 43 src="resources/sandboxed-iframe-navigation-child.html">
43 </iframe> 44 </iframe>
44 45
45 <iframe name="frameWithPlugin" 46 <iframe name="frameWithPlugin"
46 src="resources/sandboxed-iframe-plugins-frame-object.html"> 47 src="resources/sandboxed-iframe-plugins-frame-object.html">
47 </iframe> 48 </iframe>
48 49
49 <script> 50 <script>
50 description("This test verifies that a sandboxed iframe CAN navigate both it self and a child in the frame tree. " 51 description("This test verifies that a sandboxed iframe CAN navigate both it self and a child in the frame tree. "
51 + "It also verifies that the sandbox attribute remains intact af ter a frame has been navigated, " 52 + "It also verifies that the sandbox attribute remains intact af ter a frame has been navigated, "
52 + "and that sandbox attributes are propagated through the frame hierarchy."); 53 + "and that sandbox attributes are propagated through the frame hierarchy.");
53 </script> 54 </script>
54 </body> 55 </body>
55 </html> 56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698