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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 CreateBookmarkModelAndBookmarkBarView(); | 340 CreateBookmarkModelAndBookmarkBarView(); |
341 // By default, the pref is not managed and the apps shortcut is shown. | 341 // By default, the pref is not managed and the apps shortcut is shown. |
342 sync_preferences::TestingPrefServiceSyncable* prefs = | 342 sync_preferences::TestingPrefServiceSyncable* prefs = |
343 profile()->GetTestingPrefService(); | 343 profile()->GetTestingPrefService(); |
344 EXPECT_FALSE(prefs->IsManagedPreference( | 344 EXPECT_FALSE(prefs->IsManagedPreference( |
345 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); | 345 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); |
346 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); | 346 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); |
347 | 347 |
348 // Hide the apps shortcut by policy, via the managed pref. | 348 // Hide the apps shortcut by policy, via the managed pref. |
349 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 349 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
350 new base::FundamentalValue(false)); | 350 new base::Value(false)); |
351 EXPECT_FALSE(test_helper_->apps_page_shortcut()->visible()); | 351 EXPECT_FALSE(test_helper_->apps_page_shortcut()->visible()); |
352 | 352 |
353 // And try showing it via policy too. | 353 // And try showing it via policy too. |
354 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 354 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
355 new base::FundamentalValue(true)); | 355 new base::Value(true)); |
356 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); | 356 EXPECT_TRUE(test_helper_->apps_page_shortcut()->visible()); |
357 } | 357 } |
358 #endif | 358 #endif |
OLD | NEW |