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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 1262563003: Subframes in inner WebContents should not create proxies in process of outer WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from lfg@ Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698