Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: chrome/browser/ui/bookmarks/bookmark_unittest.cc

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/search_engines/template_url_service_factory.h" 5 #include "chrome/browser/search_engines/template_url_service_factory.h"
6 #include "chrome/browser/ui/tabs/tab_strip_model.h" 6 #include "chrome/browser/ui/tabs/tab_strip_model.h"
7 #include "chrome/common/url_constants.h" 7 #include "chrome/common/url_constants.h"
8 #include "chrome/test/base/browser_with_test_window_test.h" 8 #include "chrome/test/base/browser_with_test_window_test.h"
9 #include "components/search_engines/search_terms_data.h" 9 #include "components/search_engines/search_terms_data.h"
10 #include "components/search_engines/template_url_service.h" 10 #include "components/search_engines/template_url_service.h"
(...skipping 29 matching lines...) Expand all
40 browser()->tab_strip_model()->AppendWebContents(web_contents, true); 40 browser()->tab_strip_model()->AppendWebContents(web_contents, true);
41 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); 41 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state());
42 } 42 }
43 43
44 class BookmarkInstantExtendedTest : public BrowserWithTestWindowTest { 44 class BookmarkInstantExtendedTest : public BrowserWithTestWindowTest {
45 public: 45 public:
46 BookmarkInstantExtendedTest() { 46 BookmarkInstantExtendedTest() {
47 } 47 }
48 48
49 protected: 49 protected:
50 virtual TestingProfile* CreateProfile() override { 50 TestingProfile* CreateProfile() override {
51 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile(); 51 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile();
52 // TemplateURLService is normally NULL during testing. Instant extended 52 // TemplateURLService is normally NULL during testing. Instant extended
53 // needs this service so set a custom factory function. 53 // needs this service so set a custom factory function.
54 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( 54 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(
55 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService); 55 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService);
56 return profile; 56 return profile;
57 } 57 }
58 58
59 private: 59 private:
60 static KeyedService* CreateTemplateURLService( 60 static KeyedService* CreateTemplateURLService(
61 content::BrowserContext* profile) { 61 content::BrowserContext* profile) {
62 return new TemplateURLService( 62 return new TemplateURLService(
63 static_cast<Profile*>(profile)->GetPrefs(), 63 static_cast<Profile*>(profile)->GetPrefs(),
64 make_scoped_ptr(new SearchTermsData), NULL, 64 make_scoped_ptr(new SearchTermsData), NULL,
65 scoped_ptr<TemplateURLServiceClient>(), NULL, NULL, base::Closure()); 65 scoped_ptr<TemplateURLServiceClient>(), NULL, NULL, base::Closure());
66 } 66 }
67 67
68 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest); 68 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest);
69 }; 69 };
70 70
71 // Verify that in instant extended mode the detached bookmark bar is visible on 71 // Verify that in instant extended mode the detached bookmark bar is visible on
72 // the new tab page. 72 // the new tab page.
73 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) { 73 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) {
74 AddTab(browser(), GURL(chrome::kChromeUINewTabURL)); 74 AddTab(browser(), GURL(chrome::kChromeUINewTabURL));
75 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state()); 75 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state());
76 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698