OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_expanded_state_tracker.h" | 5 #include "components/bookmarks/browser/bookmark_expanded_state_tracker.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/pref_service_factory.h" | 10 #include "base/prefs/pref_service_factory.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 registry->RegisterListPref(prefs::kManagedBookmarks, | 29 registry->RegisterListPref(prefs::kManagedBookmarks, |
30 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 30 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
31 base::PrefServiceFactory factory; | 31 base::PrefServiceFactory factory; |
32 factory.set_user_prefs(make_scoped_refptr(new TestingPrefStore())); | 32 factory.set_user_prefs(make_scoped_refptr(new TestingPrefStore())); |
33 return factory.Create(registry.get()); | 33 return factory.Create(registry.get()); |
34 } | 34 } |
35 | 35 |
36 class BookmarkExpandedStateTrackerTest : public testing::Test { | 36 class BookmarkExpandedStateTrackerTest : public testing::Test { |
37 public: | 37 public: |
38 BookmarkExpandedStateTrackerTest(); | 38 BookmarkExpandedStateTrackerTest(); |
39 virtual ~BookmarkExpandedStateTrackerTest(); | 39 ~BookmarkExpandedStateTrackerTest() override; |
40 | 40 |
41 protected: | 41 protected: |
42 // testing::Test: | 42 // testing::Test: |
43 virtual void SetUp() override; | 43 void SetUp() override; |
44 virtual void TearDown() override; | 44 void TearDown() override; |
45 | 45 |
46 base::MessageLoop message_loop_; | 46 base::MessageLoop message_loop_; |
47 TestBookmarkClient client_; | 47 TestBookmarkClient client_; |
48 scoped_ptr<PrefService> prefs_; | 48 scoped_ptr<PrefService> prefs_; |
49 scoped_ptr<BookmarkModel> model_; | 49 scoped_ptr<BookmarkModel> model_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTrackerTest); | 51 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTrackerTest); |
52 }; | 52 }; |
53 | 53 |
54 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} | 54 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 tracker->SetExpandedNodes(nodes); | 107 tracker->SetExpandedNodes(nodes); |
108 // Verify that the node is present. | 108 // Verify that the node is present. |
109 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); | 109 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); |
110 // Call remove all. | 110 // Call remove all. |
111 model_->RemoveAllUserBookmarks(); | 111 model_->RemoveAllUserBookmarks(); |
112 // Verify node is not present. | 112 // Verify node is not present. |
113 EXPECT_TRUE(tracker->GetExpandedNodes().empty()); | 113 EXPECT_TRUE(tracker->GetExpandedNodes().empty()); |
114 } | 114 } |
115 | 115 |
116 } // namespace bookmarks | 116 } // namespace bookmarks |
OLD | NEW |