| OLD | NEW |
| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } else { | 151 } else { |
| 152 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); | 152 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Make sure we can also properly transition from true to false. | 155 // Make sure we can also properly transition from true to false. |
| 156 browser()->profile()->GetPrefs()->SetBoolean( | 156 browser()->profile()->GetPrefs()->SetBoolean( |
| 157 bookmarks::prefs::kShowAppsShortcutInBookmarkBar, false); | 157 bookmarks::prefs::kShowAppsShortcutInBookmarkBar, false); |
| 158 EXPECT_FALSE(test_helper_->apps_page_shortcut()->visible()); | 158 EXPECT_FALSE(test_helper_->apps_page_shortcut()->visible()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 // Various assertions around visibilty of the overflow_button. | 161 // Various assertions around visibility of the overflow_button. |
| 162 TEST_F(BookmarkBarViewTest, OverflowVisibility) { | 162 TEST_F(BookmarkBarViewTest, OverflowVisibility) { |
| 163 profile()->CreateBookmarkModel(true); | 163 profile()->CreateBookmarkModel(true); |
| 164 CreateBookmarkBarView(); | 164 CreateBookmarkBarView(); |
| 165 EXPECT_FALSE(test_helper_->overflow_button()->visible()); | 165 EXPECT_FALSE(test_helper_->overflow_button()->visible()); |
| 166 | 166 |
| 167 WaitForBookmarkModelToLoad(); | 167 WaitForBookmarkModelToLoad(); |
| 168 AddNodesToBookmarkBarFromModelString("a b c d e f "); | 168 AddNodesToBookmarkBarFromModelString("a b c d e f "); |
| 169 EXPECT_TRUE(test_helper_->overflow_button()->visible()); | 169 EXPECT_TRUE(test_helper_->overflow_button()->visible()); |
| 170 | 170 |
| 171 SizeUntilButtonsVisible(1); | 171 SizeUntilButtonsVisible(1); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 343 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
| 344 new base::FundamentalValue(false)); | 344 new base::FundamentalValue(false)); |
| 345 EXPECT_FALSE(test_helper_->apps_page_shortcut()->visible()); | 345 EXPECT_FALSE(test_helper_->apps_page_shortcut()->visible()); |
| 346 | 346 |
| 347 // And try showing it via policy too. | 347 // And try showing it via policy too. |
| 348 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 348 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
| 349 new base::FundamentalValue(true)); | 349 new base::FundamentalValue(true)); |
| 350 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); | 350 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); |
| 351 } | 351 } |
| 352 #endif | 352 #endif |
| OLD | NEW |