OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 TEST_F(BookmarkBarControllerTest, ManagedShowAppsShortcutInBookmarksBar) { | 1691 TEST_F(BookmarkBarControllerTest, ManagedShowAppsShortcutInBookmarksBar) { |
1692 // By default the pref is not managed and the apps shortcut is shown. | 1692 // By default the pref is not managed and the apps shortcut is shown. |
1693 sync_preferences::TestingPrefServiceSyncable* prefs = | 1693 sync_preferences::TestingPrefServiceSyncable* prefs = |
1694 profile()->GetTestingPrefService(); | 1694 profile()->GetTestingPrefService(); |
1695 EXPECT_FALSE(prefs->IsManagedPreference( | 1695 EXPECT_FALSE(prefs->IsManagedPreference( |
1696 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); | 1696 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); |
1697 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); | 1697 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); |
1698 | 1698 |
1699 // Hide the apps shortcut by policy, via the managed pref. | 1699 // Hide the apps shortcut by policy, via the managed pref. |
1700 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 1700 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
1701 new base::FundamentalValue(false)); | 1701 new base::Value(false)); |
1702 EXPECT_TRUE([bar_ appsPageShortcutButtonIsHidden]); | 1702 EXPECT_TRUE([bar_ appsPageShortcutButtonIsHidden]); |
1703 | 1703 |
1704 // And try showing it via policy too. | 1704 // And try showing it via policy too. |
1705 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 1705 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
1706 new base::FundamentalValue(true)); | 1706 new base::Value(true)); |
1707 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); | 1707 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); |
1708 } | 1708 } |
1709 | 1709 |
1710 class BookmarkBarControllerOpenAllTest : public BookmarkBarControllerTest { | 1710 class BookmarkBarControllerOpenAllTest : public BookmarkBarControllerTest { |
1711 public: | 1711 public: |
1712 void SetUp() override { | 1712 void SetUp() override { |
1713 BookmarkBarControllerTest::SetUp(); | 1713 BookmarkBarControllerTest::SetUp(); |
1714 ASSERT_TRUE(profile()); | 1714 ASSERT_TRUE(profile()); |
1715 | 1715 |
1716 resizeDelegate_.reset([[ViewResizerPong alloc] init]); | 1716 resizeDelegate_.reset([[ViewResizerPong alloc] init]); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 "2f3b ] 4b "); | 2180 "2f3b ] 4b "); |
2181 actual = bookmarks::test::ModelStringFromNode(root); | 2181 actual = bookmarks::test::ModelStringFromNode(root); |
2182 EXPECT_EQ(expected, actual); | 2182 EXPECT_EQ(expected, actual); |
2183 | 2183 |
2184 // Verify that the other bookmark folder can't be deleted. | 2184 // Verify that the other bookmark folder can't be deleted. |
2185 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2185 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
2186 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2186 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
2187 } | 2187 } |
2188 | 2188 |
2189 } // namespace | 2189 } // namespace |
OLD | NEW |