| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} | 39 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} |
| 40 | 40 |
| 41 BookmarkExpandedStateTrackerTest::~BookmarkExpandedStateTrackerTest() {} | 41 BookmarkExpandedStateTrackerTest::~BookmarkExpandedStateTrackerTest() {} |
| 42 | 42 |
| 43 void BookmarkExpandedStateTrackerTest::SetUp() { | 43 void BookmarkExpandedStateTrackerTest::SetUp() { |
| 44 prefs_.registry()->RegisterListPref(prefs::kBookmarkEditorExpandedNodes, | 44 prefs_.registry()->RegisterListPref(prefs::kBookmarkEditorExpandedNodes, |
| 45 new base::ListValue); | 45 new base::ListValue); |
| 46 prefs_.registry()->RegisterListPref(prefs::kManagedBookmarks); | 46 prefs_.registry()->RegisterListPref(prefs::kManagedBookmarks); |
| 47 model_.reset(new BookmarkModel(make_scoped_ptr(new TestBookmarkClient()))); | 47 model_.reset(new BookmarkModel(make_scoped_ptr(new TestBookmarkClient()))); |
| 48 model_->Load(&prefs_, std::string(), base::FilePath(), | 48 model_->Load(&prefs_, base::FilePath(), |
| 49 base::ThreadTaskRunnerHandle::Get(), | 49 base::ThreadTaskRunnerHandle::Get(), |
| 50 base::ThreadTaskRunnerHandle::Get()); | 50 base::ThreadTaskRunnerHandle::Get()); |
| 51 test::WaitForBookmarkModelToLoad(model_.get()); | 51 test::WaitForBookmarkModelToLoad(model_.get()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void BookmarkExpandedStateTrackerTest::TearDown() { | 54 void BookmarkExpandedStateTrackerTest::TearDown() { |
| 55 model_.reset(); | 55 model_.reset(); |
| 56 message_loop_.RunUntilIdle(); | 56 message_loop_.RunUntilIdle(); |
| 57 } | 57 } |
| 58 | 58 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 tracker->SetExpandedNodes(nodes); | 93 tracker->SetExpandedNodes(nodes); |
| 94 // Verify that the node is present. | 94 // Verify that the node is present. |
| 95 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); | 95 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); |
| 96 // Call remove all. | 96 // Call remove all. |
| 97 model_->RemoveAllUserBookmarks(); | 97 model_->RemoveAllUserBookmarks(); |
| 98 // Verify node is not present. | 98 // Verify node is not present. |
| 99 EXPECT_TRUE(tracker->GetExpandedNodes().empty()); | 99 EXPECT_TRUE(tracker->GetExpandedNodes().empty()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace bookmarks | 102 } // namespace bookmarks |
| OLD | NEW |