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

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

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move GetEffectiveDocumentURL to ScriptContext 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
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 chrome.test.getConfig(function(config) { 5 chrome.test.getConfig(function(config) {
6 chrome.extension.onRequest.addListener(
7 function(request, sender, sendResponse) {
8 if (request == 'parent')
9 chrome.test.succeed();
10 else
11 chrome.test.fail('Unexpected request: ' + JSON.stringify(request));
12 }
13 );
6 chrome.test.runTests([ 14 chrome.test.runTests([
7 function onRequest() { 15 function testDontInjectInAboutBlankFrame() {
8 chrome.extension.onRequest.addListener(
9 function(request, sender, sendResponse) {
10 if (request == "parent")
11 chrome.test.succeed();
12 else
13 chrome.test.fail("Unexpected request: " + JSON.stringify(request));
14 }
15 );
16 chrome.test.log("Creating tab..."); 16 chrome.test.log("Creating tab...");
17 var test_url = 17 var test_url =
18 ("http://localhost:PORT/extensions/" + 18 ("http://localhost:PORT/extensions/" +
19 "test_file_with_about_blank_iframe.html") 19 "test_file_with_about_blank_iframe.html")
20 .replace(/PORT/, config.testServer.port); 20 .replace(/PORT/, config.testServer.port);
21 chrome.tabs.create({ url: test_url }); 21 chrome.tabs.create({ url: test_url });
22 },
23 function testDontInjectInAboutSrcdocFrame() {
24 chrome.test.log('Creating tab...');
25 var test_url =
26 ('http://localhost:PORT/extensions/' +
27 'api_test/webnavigation/srcdoc/a.html')
28 .replace(/PORT/, config.testServer.port);
29 chrome.tabs.create({ url: test_url });
30 },
31 function testDontInjectInNestedAboutFrames() {
32 chrome.test.log('Creating tab...');
33 var test_url =
34 ('http://localhost:PORT/extensions/' +
35 'test_file_with_about_blank_in_srcdoc.html')
36 .replace(/PORT/, config.testServer.port);
37 chrome.tabs.create({ url: test_url });
22 } 38 }
23 ]); 39 ]);
24 }); 40 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698