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

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

Issue 288053002: Block content scripts from executing until user grants permission (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed test failures Created 6 years, 7 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 | Annotate | Revision Log
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 chrome.extension.onRequest.addListener(function(data) { 6 chrome.extension.onRequest.addListener(function(data) {
7 if (data != "ping") 7 if (data != "ping")
8 chrome.test.fail("Unexpected request: " + JSON.stringify(data)); 8 chrome.test.fail("Unexpected request: " + JSON.stringify(data));
9
10 if (++numPings == 2) 9 if (++numPings == 2)
11 chrome.test.notifyPass(); 10 chrome.test.notifyPass();
12 }); 11 });
13 12
14 chrome.test.getConfig(function(config) { 13 chrome.test.getConfig(function(config) {
15 var test_file_url = "http://localhost:PORT/extensions/test_file.html" 14 var test_file_url = "http://localhost:PORT/extensions/test_file.html"
16 .replace(/PORT/, config.testServer.port); 15 .replace(/PORT/, config.testServer.port);
17 16
18 // Add a window. 17 // Add a window.
19 var w = window.open(test_file_url); 18 var w = window.open(test_file_url);
20 19
21 // Add an iframe. 20 // Add an iframe.
22 var iframe = document.createElement("iframe"); 21 var iframe = document.createElement("iframe");
23 iframe.src = test_file_url; 22 iframe.src = test_file_url;
24 document.getElementById("iframeContainer").appendChild(iframe); 23 document.getElementById("iframeContainer").appendChild(iframe);
25 }); 24 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698