| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 EVENT_MESSAGE_EXTENSION_STRING = "Extension"; | 5 var EVENT_MESSAGE_EXTENSION_STRING = "Extension"; |
| 6 | 6 |
| 7 // Constants as functions, not to be called until after runTests. | 7 // Constants as functions, not to be called until after runTests. |
| 8 function getURLHttpSimpleLoad() { | 8 function getURLHttpSimpleLoad() { |
| 9 return getServerURL('files/extensions/api_test/webrequest/simpleLoad/a.html'); | 9 return getServerURL('extensions/api_test/webrequest/simpleLoad/a.html'); |
| 10 } | 10 } |
| 11 | 11 |
| 12 function getServerURL(path) { | 12 function getServerURL(path) { |
| 13 return 'http://www.a.com:' + testServerPort + '/' + path; | 13 return 'http://www.a.com:' + testServerPort + '/' + path; |
| 14 } | 14 } |
| 15 | 15 |
| 16 function runTests(tests) { | 16 function runTests(tests) { |
| 17 chrome.test.getConfig(function(config) { | 17 chrome.test.getConfig(function(config) { |
| 18 testServerPort = config.testServer.port; | 18 testServerPort = config.testServer.port; |
| 19 chrome.test.runTests(tests); | 19 chrome.test.runTests(tests); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 {message: EVENT_MESSAGE_EXTENSION_STRING}), | 65 {message: EVENT_MESSAGE_EXTENSION_STRING}), |
| 66 ], | 66 ], |
| 67 }; | 67 }; |
| 68 chrome.declarativeWebRequest.onRequest.addRules([rule], function() { | 68 chrome.declarativeWebRequest.onRequest.addRules([rule], function() { |
| 69 chrome.tabs.create({"url": getURLHttpSimpleLoad()}); | 69 chrome.tabs.create({"url": getURLHttpSimpleLoad()}); |
| 70 }); | 70 }); |
| 71 }); | 71 }); |
| 72 } | 72 } |
| 73 ]); | 73 ]); |
| 74 | 74 |
| OLD | NEW |