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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTrackerTest); | 51 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTrackerTest); |
52 }; | 52 }; |
53 | 53 |
54 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} | 54 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} |
55 | 55 |
56 BookmarkExpandedStateTrackerTest::~BookmarkExpandedStateTrackerTest() {} | 56 BookmarkExpandedStateTrackerTest::~BookmarkExpandedStateTrackerTest() {} |
57 | 57 |
58 void BookmarkExpandedStateTrackerTest::SetUp() { | 58 void BookmarkExpandedStateTrackerTest::SetUp() { |
59 prefs_ = PrefServiceForTesting(); | 59 prefs_ = PrefServiceForTesting(); |
60 model_.reset(new BookmarkModel(&client_, false)); | 60 model_.reset(new BookmarkModel(&client_)); |
61 model_->Load(prefs_.get(), | 61 model_->Load(prefs_.get(), |
62 std::string(), | 62 std::string(), |
63 base::FilePath(), | 63 base::FilePath(), |
64 base::MessageLoopProxy::current(), | 64 base::MessageLoopProxy::current(), |
65 base::MessageLoopProxy::current()); | 65 base::MessageLoopProxy::current()); |
66 test::WaitForBookmarkModelToLoad(model_.get()); | 66 test::WaitForBookmarkModelToLoad(model_.get()); |
67 } | 67 } |
68 | 68 |
69 void BookmarkExpandedStateTrackerTest::TearDown() { | 69 void BookmarkExpandedStateTrackerTest::TearDown() { |
70 model_.reset(); | 70 model_.reset(); |
(...skipping 36 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 |