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 assertEq = chrome.test.assertEq; | 5 var assertEq = chrome.test.assertEq; |
6 var assertTrue = chrome.test.assertTrue; | 6 var assertTrue = chrome.test.assertTrue; |
7 var numReceivedRequests = 0; | 7 var numReceivedRequests = 0; |
8 var relativePath = 'files/extensions/api_test/executescript/permissions/'; | 8 var relativePath = 'extensions/api_test/executescript/permissions/'; |
9 var testFile = relativePath + 'empty.html'; | 9 var testFile = relativePath + 'empty.html'; |
10 var testFileFrames = relativePath + 'frames.html'; | 10 var testFileFrames = relativePath + 'frames.html'; |
11 var onTabLoaded; | 11 var onTabLoaded; |
12 | 12 |
13 chrome.extension.onRequest.addListener(function(req) { | 13 chrome.extension.onRequest.addListener(function(req) { |
14 numReceivedRequests++; | 14 numReceivedRequests++; |
15 }); | 15 }); |
16 | 16 |
17 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | 17 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { |
18 if (tab.status == 'complete' && onTabLoaded) | 18 if (tab.status == 'complete' && onTabLoaded) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 {file: 'script.js', allFrames: true}); | 60 {file: 'script.js', allFrames: true}); |
61 window.setTimeout(function() { | 61 window.setTimeout(function() { |
62 chrome.test.assertEq(3, numReceivedRequests); | 62 chrome.test.assertEq(3, numReceivedRequests); |
63 chrome.test.succeed(); | 63 chrome.test.succeed(); |
64 }, 4000); | 64 }, 4000); |
65 }; | 65 }; |
66 } | 66 } |
67 ]); | 67 ]); |
68 | 68 |
69 }); | 69 }); |
OLD | NEW |