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

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: Draft Created 5 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/fast/frames/sandboxed-iframe-navigation-allowed-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 document.getElementById('sandboxedFrameId').sandbox = "allow-scripts";
29 shouldBe("document.getElementById('sandboxedFrameId').getAttribute('sandbox' )", "'allow-scripts'");
28 isSuccessfullyParsed(); 30 isSuccessfullyParsed();
29 31
30 if (window.testRunner) 32 if (window.testRunner)
31 window.testRunner.notifyDone(); 33 window.testRunner.notifyDone();
32 } 34 }
33 35
34 </script> 36 </script>
35 </head> 37 </head>
36 38
37 <body> 39 <body>
38 40
39 <iframe sandbox="allow-scripts allow-same-origin" 41 <iframe sandbox="allow-scripts allow-same-origin"
40 name="sandboxedFrame" 42 name="sandboxedFrame"
41 id="sandboxedFrameId" 43 id="sandboxedFrameId"
42 src="resources/sandboxed-iframe-navigation-child.html"> 44 src="resources/sandboxed-iframe-navigation-child.html">
43 </iframe> 45 </iframe>
44 46
45 <iframe name="frameWithPlugin" 47 <iframe name="frameWithPlugin"
46 src="resources/sandboxed-iframe-plugins-frame-object.html"> 48 src="resources/sandboxed-iframe-plugins-frame-object.html">
47 </iframe> 49 </iframe>
48 50
49 <script> 51 <script>
50 description("This test verifies that a sandboxed iframe CAN navigate both it self and a child in the frame tree. " 52 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, " 53 + "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."); 54 + "and that sandbox attributes are propagated through the frame hierarchy.");
53 </script> 55 </script>
54 </body> 56 </body>
55 </html> 57 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/frames/sandboxed-iframe-navigation-allowed-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698