OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
Mihai Parparita -not on Chrome
2012/03/30 23:29:55
This should say 2012.
eaugusti
2012/04/10 02:26:21
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 var relativePath = | |
6 '/files/extensions/api_test/executescript/run_at/test.html'; | |
7 var testUrl = 'http://b.com:PORT' + relativePath; | |
8 var firstEnter = true; | |
Mihai Parparita -not on Chrome
2012/03/30 23:29:55
This appears to be unused.
eaugusti
2012/04/10 02:26:21
Done.
| |
9 | |
10 chrome.test.getConfig(function(config) { | |
11 testUrl = testUrl.replace(/PORT/, config.testServer.port); | |
12 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | |
13 if (changeInfo.status != 'complete') | |
14 return; | |
15 chrome.tabs.onUpdated.removeListener(arguments.callee); | |
16 chrome.test.runTests([ | |
17 function executeAtStartShouldSucceed() { | |
18 var script_file = {}; | |
Mihai Parparita -not on Chrome
2012/03/30 23:29:55
The JavaScript naming style uses camelCase.
Also,
eaugusti
2012/04/10 02:26:21
Done.
| |
19 script_file.code = "document.title = 'Injected';"; | |
20 script_file.runAt = "document_start"; | |
21 chrome.tabs.executeScript(tabId, script_file, function() { | |
22 chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) { | |
23 chrome.test.assertEq('Injected', tab.title); | |
24 })); | |
25 }); | |
26 }, | |
27 ]); | |
28 }); | |
29 chrome.tabs.create({ url: testUrl }); | |
30 }); | |
OLD | NEW |