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

Unified Diff: chrome/test/data/extensions/api_test/messaging/connect/test.js

Issue 537953002: Fix race condition in ExtensionApiTest.Messaging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/messaging/connect/test.js
diff --git a/chrome/test/data/extensions/api_test/messaging/connect/test.js b/chrome/test/data/extensions/api_test/messaging/connect/test.js
index 2c11f397dda64bcab4dc663185da3b7c3c12366e..d76997fd34bccc78feb735d7c6a85a1ca5f24eed 100644
--- a/chrome/test/data/extensions/api_test/messaging/connect/test.js
+++ b/chrome/test/data/extensions/api_test/messaging/connect/test.js
@@ -28,18 +28,20 @@ chrome.test.getConfig(function(config) {
chrome.test.runTests([
function setupTestTab() {
chrome.test.log("Creating tab...");
+ var newTab = null;
+ var doneListening = listenForever(chrome.tabs.onUpdated,
+ function(_, info, tab) {
+ if (newTab && tab.id == newTab.id && info.status == 'complete') {
+ chrome.test.log("Created tab: " + tab.url);
+ testTab = tab;
+ doneListening();
+ }
+ });
chrome.tabs.create({
url: "http://localhost:PORT/extensions/test_file.html"
.replace(/PORT/, config.testServer.port)
- }, function(newTab) {
- var doneListening = listenForever(chrome.tabs.onUpdated,
- function(_, info, tab) {
- if (tab.id == newTab.id && info.status == 'complete') {
- chrome.test.log("Created tab: " + tab.url);
- testTab = tab;
- doneListening();
- }
- });
+ }, function(tab) {
+ newTab = tab;
});
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698