Chromium Code Reviews| 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..a007e388d313c63865bc404510090ed8bf87da3c 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,30 @@ function testNavOnConsecutiveSrcAttributeChanges() { |
| webview.src = testPage3; |
| } |
| +function testNestedSubframes() { |
| + var webview = document.createElement('webview'); |
| + webview.partition = 'foobar'; |
| + var nestedFrameURL = 'parent_frame.html'; |
| + webview.onconsolemessage = function(e) { |
| + window.console.log('G: ' + e.message); |
|
lfg
2015/07/31 19:35:29
Is this needed? If yes, then G wasn't very obvious
lazyboy
2015/07/31 20:36:47
Not a requirement, this is just log, I've made it
|
| + }; |
| + 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 +2830,7 @@ embedder.test.testList = { |
| 'testNavOnConsecutiveSrcAttributeChanges': |
| testNavOnConsecutiveSrcAttributeChanges, |
| 'testNavOnSrcAttributeChange': testNavOnSrcAttributeChange, |
| + 'testNestedSubframes': testNestedSubframes, |
| 'testReassignSrcAttribute': testReassignSrcAttribute, |
| 'testRemoveSrcAttribute': testRemoveSrcAttribute, |
| 'testPluginLoadInternalResource': testPluginLoadInternalResource, |