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 pass = chrome.test.callbackPass; | 5 var pass = chrome.test.callbackPass; |
6 var fail = chrome.test.callbackFail; | 6 var fail = chrome.test.callbackFail; |
7 var assertEq = chrome.test.assertEq; | 7 var assertEq = chrome.test.assertEq; |
8 var assertTrue = chrome.test.assertTrue; | 8 var assertTrue = chrome.test.assertTrue; |
9 var relativePath = | 9 var relativePath = |
10 '/files/extensions/api_test/executescript/basic/test_executescript.html'; | 10 '/extensions/api_test/executescript/basic/test_executescript.html'; |
11 var testUrl = 'http://a.com:PORT' + relativePath; | 11 var testUrl = 'http://a.com:PORT' + relativePath; |
12 var testFailureUrl = 'http://b.com:PORT' + relativePath; | 12 var testFailureUrl = 'http://b.com:PORT' + relativePath; |
13 var firstEnter = true; | 13 var firstEnter = true; |
14 | 14 |
15 chrome.test.getConfig(function(config) { | 15 chrome.test.getConfig(function(config) { |
16 testUrl = testUrl.replace(/PORT/, config.testServer.port); | 16 testUrl = testUrl.replace(/PORT/, config.testServer.port); |
17 testFailureUrl = testFailureUrl.replace(/PORT/, config.testServer.port); | 17 testFailureUrl = testFailureUrl.replace(/PORT/, config.testServer.port); |
18 | 18 |
19 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | 19 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { |
20 if (changeInfo.status != 'complete') | 20 if (changeInfo.status != 'complete') |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 chrome.tabs.executeScript(tabId, script_file, fail( | 111 chrome.tabs.executeScript(tabId, script_file, fail( |
112 'Code and file should not be specified ' + | 112 'Code and file should not be specified ' + |
113 'at the same time in the second argument.')); | 113 'at the same time in the second argument.')); |
114 } | 114 } |
115 ]); | 115 ]); |
116 }); | 116 }); |
117 | 117 |
118 chrome.tabs.create({ url: testUrl }); | 118 chrome.tabs.create({ url: testUrl }); |
119 }); | 119 }); |
120 | 120 |
OLD | NEW |