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

Side by Side Diff: chrome/test/data/extensions/api_test/content_scripts/extension_process/background.js

Issue 1715993002: OOPIF: Fix remote frame navigations from extension pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve mid-air collision in FlagExpectations/site-per-process Created 4 years, 10 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 | content/browser/frame_host/navigator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var numPings = 0; 5 var numPings = 0;
6 var base_url;
7
6 chrome.extension.onRequest.addListener(function(data) { 8 chrome.extension.onRequest.addListener(function(data) {
7 if (data != "ping") 9 if (data != "ping")
8 chrome.test.fail("Unexpected request: " + JSON.stringify(data)); 10 chrome.test.fail("Unexpected request: " + JSON.stringify(data));
9 11
10 if (++numPings == 2) 12 if (++numPings == 2) {
13 // Navigate the iframe to another page and check that the content script is
14 // also injected into that page.
15 document.querySelector("iframe").src =
16 base_url + "test_file_with_body.html";
17 } else if (numPings == 3) {
11 chrome.test.notifyPass(); 18 chrome.test.notifyPass();
19 }
12 }); 20 });
13 21
14 chrome.test.getConfig(function(config) { 22 chrome.test.getConfig(function(config) {
15 var test_file_url = "http://localhost:PORT/extensions/test_file.html" 23 base_url = "http://localhost:PORT/extensions/"
16 .replace(/PORT/, config.testServer.port); 24 .replace(/PORT/, config.testServer.port);
25 var test_file_url = base_url + "test_file.html";
17 26
18 // Add a window. 27 // Add a window.
19 var w = window.open(test_file_url); 28 var w = window.open(test_file_url);
20 29
21 // Add an iframe. 30 // Add an iframe.
22 var iframe = document.createElement("iframe"); 31 var iframe = document.createElement("iframe");
23 iframe.src = test_file_url; 32 iframe.src = test_file_url;
24 document.getElementById("iframeContainer").appendChild(iframe); 33 document.getElementById("iframeContainer").appendChild(iframe);
25 }); 34 });
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698