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

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

Issue 12217127: Alternate NTP: Show detached bookmark bar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android build Created 7 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/search_engines/template_url_service.h"
6 #include "chrome/browser/search_engines/template_url_service_factory.h"
7 #include "chrome/browser/ui/search/search.h"
8 #include "chrome/common/url_constants.h"
9 #include "chrome/test/base/browser_with_test_window_test.h"
10
11 typedef BrowserWithTestWindowTest BookmarkTest;
12
13 // Verify that the detached bookmark bar is visible on the new tab page.
14 TEST_F(BookmarkTest, DetachedBookmarkBarOnNTP) {
15 AddTab(browser(), GURL(chrome::kChromeUINewTabURL));
16 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state());
17 }
18
19 class BookmarkInstantExtendedTest : public BrowserWithTestWindowTest {
20 public:
21 BookmarkInstantExtendedTest() {
22 chrome::search::EnableInstantExtendedAPIForTesting();
23 }
24
25 protected:
26 virtual TestingProfile* CreateProfile() OVERRIDE {
27 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile();
28 // TemplateURLService is normally NULL during testing. Instant extended
29 // needs this service so set a custom factory function.
30 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(
31 profile, &BookmarkInstantExtendedTest::CreateTemplateURLService);
32 return profile;
33 }
34
35 private:
36 static ProfileKeyedService* CreateTemplateURLService(Profile* profile) {
37 return new TemplateURLService(profile);
38 }
39
40 DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest);
41 };
42
43 // Verify that in instant extended mode the detached bookmark bar is visible on
44 // the new tab page.
45 TEST_F(BookmarkInstantExtendedTest, DetachedBookmarkBarOnNTP) {
46 AddTab(browser(), GURL(chrome::kChromeUINewTabURL));
47 EXPECT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state());
48 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/bookmarks/bookmark_tab_helper.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698