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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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 | Annotate | Revision Log
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/search.h" 5 #include "chrome/browser/search/search.h"
6 #include "chrome/browser/search_engines/template_url_service.h" 6 #include "chrome/browser/search_engines/template_url_service.h"
7 #include "chrome/browser/search_engines/template_url_service_factory.h" 7 #include "chrome/browser/search_engines/template_url_service_factory.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/test/base/browser_with_test_window_test.h" 10 #include "chrome/test/base/browser_with_test_window_test.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 virtual TestingProfile* CreateProfile() OVERRIDE { 49 virtual TestingProfile* CreateProfile() OVERRIDE {
50 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile(); 50 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile();
51 // TemplateURLService is normally NULL during testing. Instant extended 51 // TemplateURLService is normally NULL during testing. Instant extended
52 // needs this service so set a custom factory function. 52 // needs this service so set a custom factory function.
53 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( 53 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(
54 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService); 54 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService);
55 return profile; 55 return profile;
56 } 56 }
57 57
58 private: 58 private:
59 static ProfileKeyedService* CreateTemplateURLService( 59 static BrowserContextKeyedService* CreateTemplateURLService(
60 content::BrowserContext* profile) { 60 content::BrowserContext* profile) {
61 return new TemplateURLService(static_cast<Profile*>(profile)); 61 return new TemplateURLService(static_cast<Profile*>(profile));
62 } 62 }
63 63
64 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest); 64 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest);
65 }; 65 };
66 66
67 // Verify that in instant extended mode the detached bookmark bar is visible on 67 // Verify that in instant extended mode the detached bookmark bar is visible on
68 // the new tab page. 68 // the new tab page.
69 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) { 69 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) {
70 AddTab(browser(), GURL(chrome::kChromeUINewTabURL)); 70 AddTab(browser(), GURL(chrome::kChromeUINewTabURL));
71 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state()); 71 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state());
72 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698