summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 17:56:11 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 17:56:11 +0000
commite9e5dc4837c41bdd6dcb3eab9a00c7cb7e2a53a5 (patch)
tree65b280aa543dd7f4ff90bd5e41cd2bf56dd635b7 /chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
parent58a468eadef7c1f69a8d11c23c039da95429396d (diff)
downloadchromium_src-e9e5dc4837c41bdd6dcb3eab9a00c7cb7e2a53a5.zip
chromium_src-e9e5dc4837c41bdd6dcb3eab9a00c7cb7e2a53a5.tar.gz
chromium_src-e9e5dc4837c41bdd6dcb3eab9a00c7cb7e2a53a5.tar.bz2
Fix Valgrind error in ExtensionInstalledBubble unit test.
BUG= 34052 TEST= no valgrind error. Review URL: http://codereview.chromium.org/555199 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm21
1 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm b/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
index 8f1d4d5..6cf27c9 100644
--- a/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
+++ b/chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm
@@ -22,17 +22,17 @@
// to a no-op, because pageActions are not yet hooked up in the test browser.
@interface ExtensionInstalledBubbleControllerForTest :
ExtensionInstalledBubbleController {
- }
+}
- // Do nothing, because browser window is not set up with page actions
- // for unit testing.
+// Do nothing, because browser window is not set up with page actions
+// for unit testing.
- (void)removePageActionPreview;
@end
@implementation ExtensionInstalledBubbleControllerForTest
- -(void)removePageActionPreview { }
+- (void)removePageActionPreview { }
@end
@@ -112,19 +112,21 @@ class ExtensionInstalledBubbleControllerTest : public CocoaTest {
// Required to initialize the extension installed bubble.
Browser* browser_; // weak, owned by BrowserTestHelper.
+ // Skeleton extension to be tested; reinitialized for each test.
+ scoped_ptr<Extension> extension_;
+
// The icon_ to be loaded into the bubble window.
SkBitmap icon_;
};
// Confirm that window sizes are set correctly for a page action extension.
TEST_F(ExtensionInstalledBubbleControllerTest, PageActionTest) {
- scoped_ptr<Extension> extension;
- extension.reset(
+ extension_.reset(
CreateExtension(extension_installed_bubble::kPageAction));
ExtensionInstalledBubbleControllerForTest* controller =
[[ExtensionInstalledBubbleControllerForTest alloc]
initWithParentWindow:window_
- extension:extension.get()
+ extension:extension_.get()
browser:browser_
icon:icon_];
EXPECT_TRUE(controller);
@@ -162,13 +164,12 @@ TEST_F(ExtensionInstalledBubbleControllerTest, PageActionTest) {
}
TEST_F(ExtensionInstalledBubbleControllerTest, BrowserActionTest) {
- scoped_ptr<Extension> extension;
- extension.reset(
+ extension_.reset(
CreateExtension(extension_installed_bubble::kBrowserAction));
ExtensionInstalledBubbleControllerForTest* controller =
[[ExtensionInstalledBubbleControllerForTest alloc]
initWithParentWindow:window_
- extension:extension.get()
+ extension:extension_.get()
browser:browser_
icon:icon_];
EXPECT_TRUE(controller);