Index: chrome/test/data/extensions/platform_apps/web_view/shim/main.js |
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js |
index 619bda560ddf58476fa91dfa6736405bc4591f39..e45b3bfbd6e1a75f7309685fa95cafc53755a7d2 100644 |
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js |
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js |
@@ -1332,6 +1332,54 @@ function testNavOnConsecutiveSrcAttributeChanges() { |
webview.src = testPage3; |
} |
+function testNestedCrossOriginSubframes() { |
+ var webview = document.createElement('webview'); |
+ var nestedFrameURL = embedder.baseGuestURL + |
+ '/extensions/platform_apps/web_view/shim/parent_frame.html'; |
+ webview.onconsolemessage = function(e) { |
+ window.console.log('guest.consolemessage ' + e.message); |
+ }; |
+ webview.onloadstop = function() { |
+ window.onmessage = function(e) { |
+ if (e.data == 'frames-loaded') { |
+ embedder.test.succeed(); |
+ } |
+ }; |
+ |
+ // Ask the <webview> to load nested frames. It will reply via postMessage |
+ // once frames have finished loading. |
+ webview.contentWindow.postMessage('load-frames', '*'); |
+ }; |
+ webview.onloadabort = embedder.test.fail; |
+ |
+ webview.src = nestedFrameURL; |
+ document.body.appendChild(webview); |
+} |
+ |
+function testNestedSubframes() { |
+ var webview = document.createElement('webview'); |
+ webview.partition = 'foobar'; |
+ var nestedFrameURL = 'parent_frame.html'; |
+ webview.onconsolemessage = function(e) { |
+ window.console.log('guest.consolemessage ' + e.message); |
+ }; |
+ webview.onloadstop = function() { |
+ window.onmessage = function(e) { |
+ if (e.data == 'frames-loaded') { |
+ embedder.test.succeed(); |
+ } |
+ }; |
+ |
+ // Ask the <webview> to load nested frames. It will reply via postMessage |
+ // once frames have finished loading. |
+ webview.contentWindow.postMessage('load-frames', '*'); |
+ }; |
+ webview.onloadabort = embedder.test.fail; |
+ |
+ webview.src = nestedFrameURL; |
+ document.body.appendChild(webview); |
+} |
+ |
// This test verifies that we can set the <webview> src multiple times and the |
// changes will cause a navigation. |
function testNavOnSrcAttributeChange() { |
@@ -2806,6 +2854,8 @@ embedder.test.testList = { |
'testNavOnConsecutiveSrcAttributeChanges': |
testNavOnConsecutiveSrcAttributeChanges, |
'testNavOnSrcAttributeChange': testNavOnSrcAttributeChange, |
+ 'testNestedCrossOriginSubframes': testNestedCrossOriginSubframes, |
+ 'testNestedSubframes': testNestedSubframes, |
'testReassignSrcAttribute': testReassignSrcAttribute, |
'testRemoveSrcAttribute': testRemoveSrcAttribute, |
'testPluginLoadInternalResource': testPluginLoadInternalResource, |