summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm16
1 files changed, 7 insertions, 9 deletions
diff --git a/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm b/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
index adcc426..ad68c85 100644
--- a/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
+++ b/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
@@ -75,7 +75,8 @@ class ExtensionInstalledBubbleControllerTest : public CocoaTest {
// Create a skeletal framework of either page action or browser action
// type. This extension only needs to have a type and a name to initialize
// the ExtensionInstalledBubble for unit testing.
- Extension* CreateExtension(extension_installed_bubble::ExtensionType type) {
+ scoped_refptr<Extension> CreateExtension(
+ extension_installed_bubble::ExtensionType type) {
FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
path = path.AppendASCII("extensions").AppendASCII("dummy");
@@ -98,10 +99,9 @@ class ExtensionInstalledBubbleControllerTest : public CocoaTest {
extension_input_value.Set(keys::kBrowserAction, browser_action);
}
- Extension* extension = new Extension(path);
std::string error;
- extension->InitFromValue(extension_input_value, false, &error);
- return extension;
+ return Extension::Create(
+ path, Extension::INVALID, extension_input_value, false, &error);
}
// Allows us to create the window and browser for testing.
@@ -114,7 +114,7 @@ class ExtensionInstalledBubbleControllerTest : public CocoaTest {
Browser* browser_; // weak, owned by BrowserTestHelper.
// Skeleton extension to be tested; reinitialized for each test.
- scoped_ptr<Extension> extension_;
+ scoped_refptr<Extension> extension_;
// The icon_ to be loaded into the bubble window.
SkBitmap icon_;
@@ -122,8 +122,7 @@ class ExtensionInstalledBubbleControllerTest : public CocoaTest {
// Confirm that window sizes are set correctly for a page action extension.
TEST_F(ExtensionInstalledBubbleControllerTest, PageActionTest) {
- extension_.reset(
- CreateExtension(extension_installed_bubble::kPageAction));
+ extension_ = CreateExtension(extension_installed_bubble::kPageAction);
ExtensionInstalledBubbleControllerForTest* controller =
[[ExtensionInstalledBubbleControllerForTest alloc]
initWithParentWindow:window_
@@ -166,8 +165,7 @@ TEST_F(ExtensionInstalledBubbleControllerTest, PageActionTest) {
}
TEST_F(ExtensionInstalledBubbleControllerTest, BrowserActionTest) {
- extension_.reset(
- CreateExtension(extension_installed_bubble::kBrowserAction));
+ extension_ = CreateExtension(extension_installed_bubble::kBrowserAction);
ExtensionInstalledBubbleControllerForTest* controller =
[[ExtensionInstalledBubbleControllerForTest alloc]
initWithParentWindow:window_