Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/webrequest/framework.js |
| diff --git a/chrome/test/data/extensions/api_test/webrequest/framework.js b/chrome/test/data/extensions/api_test/webrequest/framework.js |
| index 7a13b11aef9d0f5508d028e66e3cc5bc37fb174d..3ab272fd248f27136f15daf6248eb3d708325494 100644 |
| --- a/chrome/test/data/extensions/api_test/webrequest/framework.js |
| +++ b/chrome/test/data/extensions/api_test/webrequest/framework.js |
| @@ -8,6 +8,7 @@ var expectedEventData; |
| var capturedEventData; |
| var expectedEventOrder; |
| var tabId; |
| +var tabIdMap; |
| var testServerPort; |
| var testServer = "www.a.com"; |
| var eventsCaptured; |
| @@ -15,6 +16,8 @@ var eventsCaptured; |
| function runTests(tests) { |
| chrome.tabs.create({url: "about:blank"}, function(tab) { |
| tabId = tab.id; |
| + tabIdMap = {}; |
| + tabIdMap[tabId] = 0; |
| chrome.test.getConfig(function(config) { |
| testServerPort = config.testServer.port; |
| chrome.test.runTests(tests); |
| @@ -71,7 +74,7 @@ function expect(data, order, filter, extraInfoSpec) { |
| expectedEventData[i].details.method = "GET"; |
| } |
| if (!expectedEventData[i].details.tabId) { |
| - expectedEventData[i].details.tabId = tabId; |
| + expectedEventData[i].details.tabId = tabIdMap[tabId]; |
| } |
| if (!expectedEventData[i].details.type) { |
| expectedEventData[i].details.type = "main_frame"; |
| @@ -161,6 +164,11 @@ function captureEvent(name, details, callback) { |
| } |
| delete details.frameId; |
| + if (!(details.tabId in tabIdMap)) { |
|
battre
2011/10/28 13:27:50
Nit/optional: Add comment to not open two new tabs
|
| + tabIdMap[details.tabId] = Object.keys(tabIdMap).length; |
| + } |
| + details.tabId = tabIdMap[details.tabId]; |
| + |
| delete details.requestId; |
| delete details.timeStamp; |
| if (details.requestHeaders) { |