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

Unified Diff: extensions/browser/api_unittest.h

Issue 789643004: Move chrome.alarms API from chrome/ to extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 11 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 | « extensions/browser/api_test_utils.cc ('k') | extensions/browser/api_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api_unittest.h
diff --git a/extensions/browser/api_unittest.h b/extensions/browser/api_unittest.h
index 2b1c46854f0b2bb161a9a101dced70cd1fafb5f8..f26629d35e68bbdf8cd1b6d7ceb2e73ab1dd3afb 100644
--- a/extensions/browser/api_unittest.h
+++ b/extensions/browser/api_unittest.h
@@ -22,6 +22,7 @@ class ListValue;
namespace content {
class NotificationService;
class TestBrowserThreadBundle;
+class WebContents;
}
class UIThreadExtensionFunction;
@@ -39,6 +40,7 @@ class ApiUnitTest : public ExtensionsTest {
ApiUnitTest();
~ApiUnitTest() override;
+ content::WebContents* contents() { return contents_.get(); }
const Extension* extension() const { return extension_.get(); }
scoped_refptr<Extension> extension_ref() { return extension_; }
void set_extension(scoped_refptr<Extension> extension) {
@@ -49,6 +51,11 @@ class ApiUnitTest : public ExtensionsTest {
// SetUp creates and loads an empty, unpacked Extension.
void SetUp() override;
+ // Creates a background page for |extension_|, and sets it for the WebContents
+ // to be used in API calls.
+ // If |contents_| is already set, this does nothing.
+ void CreateBackgroundPage();
+
// Various ways of running an API function. These methods take ownership of
// |function|. |args| should be in JSON format, wrapped in a list.
// See also the RunFunction* methods in extension_function_test_utils.h.
@@ -87,6 +94,10 @@ class ApiUnitTest : public ExtensionsTest {
MockExtensionSystemFactory<MockExtensionSystem> extension_system_factory_;
+ // The WebContents used to associate a RenderViewHost with API function calls,
+ // or null.
+ scoped_ptr<content::WebContents> contents_;
+
// The Extension used when running API function calls.
scoped_refptr<Extension> extension_;
};
« no previous file with comments | « extensions/browser/api_test_utils.cc ('k') | extensions/browser/api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698