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 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 TEST_F(BookmarkBarControllerTest, ManagedShowAppsShortcutInBookmarksBar) { | 1684 TEST_F(BookmarkBarControllerTest, ManagedShowAppsShortcutInBookmarksBar) { |
1685 // By default the pref is not managed and the apps shortcut is shown. | 1685 // By default the pref is not managed and the apps shortcut is shown. |
1686 sync_preferences::TestingPrefServiceSyncable* prefs = | 1686 sync_preferences::TestingPrefServiceSyncable* prefs = |
1687 profile()->GetTestingPrefService(); | 1687 profile()->GetTestingPrefService(); |
1688 EXPECT_FALSE(prefs->IsManagedPreference( | 1688 EXPECT_FALSE(prefs->IsManagedPreference( |
1689 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); | 1689 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); |
1690 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); | 1690 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); |
1691 | 1691 |
1692 // Hide the apps shortcut by policy, via the managed pref. | 1692 // Hide the apps shortcut by policy, via the managed pref. |
1693 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 1693 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
1694 new base::FundamentalValue(false)); | 1694 new base::Value(false)); |
1695 EXPECT_TRUE([bar_ appsPageShortcutButtonIsHidden]); | 1695 EXPECT_TRUE([bar_ appsPageShortcutButtonIsHidden]); |
1696 | 1696 |
1697 // And try showing it via policy too. | 1697 // And try showing it via policy too. |
1698 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 1698 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
1699 new base::FundamentalValue(true)); | 1699 new base::Value(true)); |
1700 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); | 1700 EXPECT_FALSE([bar_ appsPageShortcutButtonIsHidden]); |
1701 } | 1701 } |
1702 | 1702 |
1703 class BookmarkBarControllerOpenAllTest : public BookmarkBarControllerTest { | 1703 class BookmarkBarControllerOpenAllTest : public BookmarkBarControllerTest { |
1704 public: | 1704 public: |
1705 void SetUp() override { | 1705 void SetUp() override { |
1706 BookmarkBarControllerTest::SetUp(); | 1706 BookmarkBarControllerTest::SetUp(); |
1707 ASSERT_TRUE(profile()); | 1707 ASSERT_TRUE(profile()); |
1708 | 1708 |
1709 resizeDelegate_.reset([[ViewResizerPong alloc] init]); | 1709 resizeDelegate_.reset([[ViewResizerPong alloc] init]); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 "2f3b ] 4b "); | 2173 "2f3b ] 4b "); |
2174 actual = bookmarks::test::ModelStringFromNode(root); | 2174 actual = bookmarks::test::ModelStringFromNode(root); |
2175 EXPECT_EQ(expected, actual); | 2175 EXPECT_EQ(expected, actual); |
2176 | 2176 |
2177 // Verify that the other bookmark folder can't be deleted. | 2177 // Verify that the other bookmark folder can't be deleted. |
2178 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2178 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
2179 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2179 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
2180 } | 2180 } |
2181 | 2181 |
2182 } // namespace | 2182 } // namespace |
OLD | NEW |