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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc

Issue 16172005: Clean up async app launcher enabled checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/views/bookmarks/bookmark_bar_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
6 6
7 #include "apps/app_launcher.h" 7 #include "apps/app_launcher.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search/search.h" 10 #include "chrome/browser/search/search.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 BookmarkBarView bookmark_bar_view(browser(), NULL); 67 BookmarkBarView bookmark_bar_view(browser(), NULL);
68 bookmark_bar_view.set_owned_by_client(); 68 bookmark_bar_view.set_owned_by_client();
69 browser()->profile()->GetPrefs()->SetBoolean( 69 browser()->profile()->GetPrefs()->SetBoolean(
70 prefs::kShowAppsShortcutInBookmarkBar, false); 70 prefs::kShowAppsShortcutInBookmarkBar, false);
71 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); 71 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible());
72 72
73 // Try to make the Apps shortcut visible. Its visibility depends on whether 73 // Try to make the Apps shortcut visible. Its visibility depends on whether
74 // the app launcher is enabled. 74 // the app launcher is enabled.
75 browser()->profile()->GetPrefs()->SetBoolean( 75 browser()->profile()->GetPrefs()->SetBoolean(
76 prefs::kShowAppsShortcutInBookmarkBar, true); 76 prefs::kShowAppsShortcutInBookmarkBar, true);
77 if (apps::WasAppLauncherEnabled()) { 77 if (apps::IsAppLauncherEnabled()) {
78 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); 78 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible());
79 } else { 79 } else {
80 EXPECT_TRUE(bookmark_bar_view.apps_page_shortcut_->visible()); 80 EXPECT_TRUE(bookmark_bar_view.apps_page_shortcut_->visible());
81 } 81 }
82 82
83 // Make sure we can also properly transition from true to false. 83 // Make sure we can also properly transition from true to false.
84 browser()->profile()->GetPrefs()->SetBoolean( 84 browser()->profile()->GetPrefs()->SetBoolean(
85 prefs::kShowAppsShortcutInBookmarkBar, false); 85 prefs::kShowAppsShortcutInBookmarkBar, false);
86 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); 86 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible());
87 } 87 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698