diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 16:08:56 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 16:08:56 +0000 |
commit | 966ddf0958e0e3eb3a145c5a9908bc8662e174be (patch) | |
tree | af28e0e229edaed4f7e36b6d0414733990df78cb /chrome | |
parent | 0ed5386b521ed354bc5748bf0b40894080890779 (diff) | |
download | chromium_src-966ddf0958e0e3eb3a145c5a9908bc8662e174be.zip chromium_src-966ddf0958e0e3eb3a145c5a9908bc8662e174be.tar.gz chromium_src-966ddf0958e0e3eb3a145c5a9908bc8662e174be.tar.bz2 |
[Mac] Centralize hack to make tests work with AutocompleteClassifier.
A recent change added AutocompleteClassifier, which had to be hacked
into the testing profile to make tests with real location bars work.
Unfortunately, more code is tripping over this, so I'm moving the hack
to a central location rather than adding it case-by-case.
Issue 39725 is about removing the need for this.
BUG=39725
TEST=trybots.
Review URL: http://codereview.chromium.org/1618028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/browser_test_helper.h | 9 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller_unittest.mm | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/browser_test_helper.h b/chrome/browser/cocoa/browser_test_helper.h index 0420c7a..b7e3e64 100644 --- a/chrome/browser/cocoa/browser_test_helper.h +++ b/chrome/browser/cocoa/browser_test_helper.h @@ -25,6 +25,15 @@ class BrowserTestHelper { profile_.reset(new TestingProfile()); profile_->CreateBookmarkModel(true); profile_->BlockUntilBookmarkModelLoaded(); + + // TODO(shess): These are needed in case someone creates a browser + // window off of browser_. pkasting indicates that other + // platforms use a stub |BrowserWindow| and thus don't need to do + // this. + // http://crbug.com/39725 + profile_->CreateAutocompleteClassifier(); + profile_->CreateTemplateURLModel(); + browser_.reset(new Browser(Browser::TYPE_NORMAL, profile_.get())); } diff --git a/chrome/browser/cocoa/tab_strip_controller_unittest.mm b/chrome/browser/cocoa/tab_strip_controller_unittest.mm index 7cbe16e..82cea8e 100644 --- a/chrome/browser/cocoa/tab_strip_controller_unittest.mm +++ b/chrome/browser/cocoa/tab_strip_controller_unittest.mm @@ -120,10 +120,6 @@ class TabStripControllerTest : public CocoaTest { // Test adding and removing tabs and making sure that views get added to // the tab strip. TEST_F(TabStripControllerTest, AddRemoveTabs) { - // Create the objects we need, since we have a real location bar. - browser_helper_.profile()->CreateAutocompleteClassifier(); - browser_helper_.profile()->CreateTemplateURLModel(); - EXPECT_TRUE(model_->empty()); SiteInstance* instance = SiteInstance::CreateSiteInstance(browser_helper_.profile()); |