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

Unified Diff: chrome/browser/extensions/browsertest_util.h

Issue 23874006: Add a function to send scripts from a browsertest to an extension's background page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add browsertest_util.cc to other binaries to fix link errors Created 7 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
Index: chrome/browser/extensions/browsertest_util.h
diff --git a/chrome/browser/extensions/browsertest_util.h b/chrome/browser/extensions/browsertest_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7a1ec21421096d7bfdbf2dfe50486b5b49daa56
--- /dev/null
+++ b/chrome/browser/extensions/browsertest_util.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 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.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_BROWSERTEST_UTIL_H_
+#define CHROME_BROWSER_EXTENSIONS_BROWSERTEST_UTIL_H_
+
+#include <string>
+
+class Profile;
+
+namespace extensions {
+namespace browsertest_util {
+
+// Waits until |script| calls "window.domAutomationController.send(result)",
+// where |result| is a string, and returns |result|. Fails the test and returns
+// an empty string if |extension_id| isn't installed in |profile| or doesn't
+// have a background page, or if executing the script fails.
not at google - send to devlin 2013/09/04 02:15:16 what happens if the test doesn't return a string?
Jeffrey Yasskin 2013/09/04 02:48:44 Yep, and now I've tested that.
+std::string ExecuteScriptInBackgroundPage(Profile* profile,
+ const std::string& extension_id,
+ const std::string& script);
+
+} // namespace browsertest_util
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_BROWSERTEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698