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

Unified Diff: chrome/browser/extensions/extension_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: 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/extension_browsertest_util.h
diff --git a/chrome/browser/extensions/extension_browsertest_util.h b/chrome/browser/extensions/extension_browsertest_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed81762825aeb51a835f40d3f094fb3509a1c24a
--- /dev/null
+++ b/chrome/browser/extensions/extension_browsertest_util.h
@@ -0,0 +1,24 @@
+// 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_EXTENSION_BROWSERTEST_UTIL_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_UTIL_H_
not at google - send to devlin 2013/09/03 23:13:38 just browsertest_util?
Jeffrey Yasskin 2013/09/03 23:33:13 Sure, done.
+
+#include <string>
+
+class Profile;
+
+namespace extensions {
+
not at google - send to devlin 2013/09/03 23:13:38 can we put this file in a browsertest_util namespa
Jeffrey Yasskin 2013/09/03 23:33:13 After some discussion about a 'testing' namespace
+// Waits until |script| calls "window.domAutomationController.send('string')"
not at google - send to devlin 2013/09/03 23:13:38 what is 'string'?
Jeffrey Yasskin 2013/09/03 23:33:13 How's the new comment?
+// and returns the string. 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.
+std::string ExecuteScriptInBackgroundPage(Profile* profile,
+ const std::string& extension_id,
+ const std::string& script);
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698