Index: chrome/test/webdriver/test/infobar_browser_action_extension/bg.js |
diff --git a/chrome/test/webdriver/test/infobar_browser_action_extension/bg.js b/chrome/test/webdriver/test/infobar_browser_action_extension/bg.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9a2fa6202878f8726179086a4bfd02e7d3bcf819 |
--- /dev/null |
+++ b/chrome/test/webdriver/test/infobar_browser_action_extension/bg.js |
@@ -0,0 +1,20 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+var g_infobarReady = false; |
+var g_callback = null; |
+function waitForInfobar(callback) { |
+ if (g_infobarReady) |
+ callback(); |
+ g_callback = callback; |
+} |
+ |
+chrome.tabs.getSelected(null, function(tab) { |
+ chrome.experimental.infobars.show( |
+ {'tabId': tab.id, 'path': 'view_checks.html'}, function() { |
+ g_infobarReady = true; |
+ if (g_callback) |
+ g_callback(); |
+ }); |
+}); |