OLD | NEW |
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 }); |
OLD | NEW |