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 firstEnter = true; | 5 var firstEnter = true; |
6 | 6 |
7 chrome.test.getConfig(function(config) { | 7 chrome.test.getConfig(function(config) { |
8 chrome.test.log('Creating tab...'); | 8 chrome.test.log('Creating tab...'); |
9 | 9 |
10 var URL = 'http://localhost:PORT/files/extensions/test_file_with_body.html'; | 10 var URL = 'http://localhost:PORT/extensions/test_file_with_body.html'; |
11 var TEST_FILE_URL = URL.replace(/PORT/, config.testServer.port); | 11 var TEST_FILE_URL = URL.replace(/PORT/, config.testServer.port); |
12 | 12 |
13 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | 13 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { |
14 if (changeInfo.status != 'complete') | 14 if (changeInfo.status != 'complete') |
15 return; | 15 return; |
16 if (!firstEnter) | 16 if (!firstEnter) |
17 return; | 17 return; |
18 firstEnter = false; | 18 firstEnter = false; |
19 | 19 |
20 // We need to test two different paths, because the message bundles used | 20 // We need to test two different paths, because the message bundles used |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 script_file.file = 'test_paragraph_style.js'; | 65 script_file.file = 'test_paragraph_style.js'; |
66 chrome.tabs.executeScript(tabId,script_file); | 66 chrome.tabs.executeScript(tabId,script_file); |
67 }); | 67 }); |
68 } | 68 } |
69 | 69 |
70 ]); | 70 ]); |
71 }); | 71 }); |
72 | 72 |
73 chrome.tabs.create({ url: TEST_FILE_URL }); | 73 chrome.tabs.create({ url: TEST_FILE_URL }); |
74 }); | 74 }); |
OLD | NEW |