diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 23:07:08 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 23:07:08 +0000 |
commit | 0e64095b374f53899df0a88fefc1e60b062b88de (patch) | |
tree | 27bfbe167fcfd3340f9aa9afd3b67ae50941146e /chrome | |
parent | e38baf689097b646f0200f9698d8b91f6e1daf92 (diff) | |
download | chromium_src-0e64095b374f53899df0a88fefc1e60b062b88de.zip chromium_src-0e64095b374f53899df0a88fefc1e60b062b88de.tar.gz chromium_src-0e64095b374f53899df0a88fefc1e60b062b88de.tar.bz2 |
Move some more tests over to CocoaTest
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/405022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/download_util_mac_unittest.mm | 3 | ||||
-rw-r--r-- | chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm | 45 |
2 files changed, 27 insertions, 21 deletions
diff --git a/chrome/browser/cocoa/download_util_mac_unittest.mm b/chrome/browser/cocoa/download_util_mac_unittest.mm index 8d1939c..85835e0 100644 --- a/chrome/browser/cocoa/download_util_mac_unittest.mm +++ b/chrome/browser/cocoa/download_util_mac_unittest.mm @@ -14,7 +14,7 @@ namespace { -class DownloadUtilTest : public PlatformTest { +class DownloadUtilTest : public CocoaTest { public: DownloadUtilTest() { pasteboard_ = [NSPasteboard pasteboardWithUniqueName]; @@ -27,7 +27,6 @@ class DownloadUtilTest : public PlatformTest { const NSPasteboard* const pasteboard() { return pasteboard_; } private: - CocoaTestHelper cocoa_helper_; NSPasteboard* pasteboard_; }; diff --git a/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm b/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm index 8e75c33..e7d690c 100644 --- a/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm +++ b/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm @@ -44,21 +44,26 @@ namespace { -class EditSearchEngineControllerTest : public PlatformTest { +class EditSearchEngineControllerTest : public CocoaTest { public: - void SetUp() { + virtual void SetUp() { + CocoaTest::SetUp(); TestingProfile* profile = static_cast<TestingProfile*>(browser_helper_.profile()); profile->CreateTemplateURLModel(); - controller_.reset([[FakeEditSearchEngineController alloc] - initWithProfile:profile - delegate:nil - templateURL:nil]); + controller_ = [[FakeEditSearchEngineController alloc] + initWithProfile:profile + delegate:nil + templateURL:nil]; } - CocoaTestHelper cocoa_helper_; - BrowserTestHelper browser_helper_; - scoped_nsobject<FakeEditSearchEngineController> controller_; + virtual void TearDown() { + [controller_ close]; + CocoaTest::TearDown(); + } + + BrowserTestHelper browser_helper_; + FakeEditSearchEngineController* controller_; }; TEST_F(EditSearchEngineControllerTest, ValidImageOriginals) { @@ -199,21 +204,23 @@ TEST_F(EditSearchEngineControllerTest, EditTemplateURL) { std::wstring urlString = TemplateURLRef::DisplayURLToURLRef( L"http://foo-bar.com"); url.SetURL(urlString, 0, 1); - controller_.reset([[FakeEditSearchEngineController alloc] - initWithProfile:browser_helper_.profile() - delegate:nil - templateURL:&url]); - EXPECT_TRUE([controller_ window]); + TestingProfile* profile = browser_helper_.profile(); + FakeEditSearchEngineController *controller = + [[FakeEditSearchEngineController alloc] initWithProfile:profile + delegate:nil + templateURL:&url]; + EXPECT_TRUE([controller window]); NSString* title = l10n_util::GetNSString( IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE); - EXPECT_TRUE([title isEqualToString:[[controller_ window] title]]); - NSString* nameString = [[controller_ nameField] stringValue]; + EXPECT_TRUE([title isEqualToString:[[controller window] title]]); + NSString* nameString = [[controller nameField] stringValue]; EXPECT_TRUE([@"Foobar" isEqualToString:nameString]); - NSString* keywordString = [[controller_ keywordField] stringValue]; + NSString* keywordString = [[controller keywordField] stringValue]; EXPECT_TRUE([@"keyword" isEqualToString:keywordString]); - NSString* urlValueString = [[controller_ urlField] stringValue]; + NSString* urlValueString = [[controller urlField] stringValue]; EXPECT_TRUE([@"http://foo-bar.com" isEqualToString:urlValueString]); - EXPECT_TRUE([controller_ validateFields]); + EXPECT_TRUE([controller validateFields]); + [controller close]; } } // namespace |