Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6704)

Unified Diff: chrome/test/data/extensions/api_test/webrequest/framework.js

Issue 8404046: When creating a tab contents for a browser in the RVHDelegateHelper, create a wrapper immediately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/test/data/extensions/api_test/webrequest/newTab/a.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/test/data/extensions/api_test/webrequest/newTab/a.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698