| 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..f7e21577f43d0d070f189b7e7b532d0b53fc57c4 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,13 @@ function captureEvent(name, details, callback) {
|
| }
|
| delete details.frameId;
|
|
|
| + // This assigns unique IDs to newly opened tabs. However, the new IDs are only
|
| + // deterministic, if the order in which the tabs are opened is deterministic.
|
| + if (!(details.tabId in tabIdMap)) {
|
| + tabIdMap[details.tabId] = Object.keys(tabIdMap).length;
|
| + }
|
| + details.tabId = tabIdMap[details.tabId];
|
| +
|
| delete details.requestId;
|
| delete details.timeStamp;
|
| if (details.requestHeaders) {
|
|
|