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 var server = 'http://b.com:PORT'; | 5 var server = 'http://b.com:PORT'; |
6 var relativePath = '/files/extensions/api_test/executescript/file_after_close/'; | 6 var relativePath = '/extensions/api_test/executescript/file_after_close/'; |
7 var extensionPage = chrome.extension.getURL('extension_page.html'); | 7 var extensionPage = chrome.extension.getURL('extension_page.html'); |
8 var webPage1 = server + relativePath + 'web_page1.html'; | 8 var webPage1 = server + relativePath + 'web_page1.html'; |
9 var webPage2 = server + relativePath + 'web_page2.html'; | 9 var webPage2 = server + relativePath + 'web_page2.html'; |
10 var extensionPageOpened = false; | 10 var extensionPageOpened = false; |
11 | 11 |
12 var listener = function(tabId, changeInfo, tab) { | 12 var listener = function(tabId, changeInfo, tab) { |
13 if (changeInfo.status != 'complete') | 13 if (changeInfo.status != 'complete') |
14 return; | 14 return; |
15 | 15 |
16 // web_page1 loaded, open extension page to inject script | 16 // web_page1 loaded, open extension page to inject script |
(...skipping 10 matching lines...) Expand all Loading... |
27 } | 27 } |
28 }; | 28 }; |
29 | 29 |
30 chrome.tabs.onUpdated.addListener(listener); | 30 chrome.tabs.onUpdated.addListener(listener); |
31 chrome.test.getConfig(function(config) { | 31 chrome.test.getConfig(function(config) { |
32 webPage1 = webPage1.replace(/PORT/, config.testServer.port); | 32 webPage1 = webPage1.replace(/PORT/, config.testServer.port); |
33 webPage2 = webPage2.replace(/PORT/, config.testServer.port); | 33 webPage2 = webPage2.replace(/PORT/, config.testServer.port); |
34 chrome.tabs.create({ url: webPage1 }); | 34 chrome.tabs.create({ url: webPage1 }); |
35 }); | 35 }); |
36 | 36 |
OLD | NEW |