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_; |
}; |