Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: components/bookmarks/browser/bookmark_expanded_state_tracker_unittest.cc

Issue 2784513002: Move PrefRegistrySimple to use unique_ptr<Value> (Closed)
Patch Set: Android Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 26 matching lines...) Expand all
37 37
38 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTrackerTest); 38 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTrackerTest);
39 }; 39 };
40 40
41 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {} 41 BookmarkExpandedStateTrackerTest::BookmarkExpandedStateTrackerTest() {}
42 42
43 BookmarkExpandedStateTrackerTest::~BookmarkExpandedStateTrackerTest() {} 43 BookmarkExpandedStateTrackerTest::~BookmarkExpandedStateTrackerTest() {}
44 44
45 void BookmarkExpandedStateTrackerTest::SetUp() { 45 void BookmarkExpandedStateTrackerTest::SetUp() {
46 prefs_.registry()->RegisterListPref(prefs::kBookmarkEditorExpandedNodes, 46 prefs_.registry()->RegisterListPref(prefs::kBookmarkEditorExpandedNodes,
47 new base::ListValue); 47 base::MakeUnique<base::ListValue>());
48 prefs_.registry()->RegisterListPref(prefs::kManagedBookmarks); 48 prefs_.registry()->RegisterListPref(prefs::kManagedBookmarks);
49 model_.reset(new BookmarkModel(base::MakeUnique<TestBookmarkClient>())); 49 model_.reset(new BookmarkModel(base::MakeUnique<TestBookmarkClient>()));
50 model_->Load(&prefs_, base::FilePath(), 50 model_->Load(&prefs_, base::FilePath(),
51 base::ThreadTaskRunnerHandle::Get(), 51 base::ThreadTaskRunnerHandle::Get(),
52 base::ThreadTaskRunnerHandle::Get()); 52 base::ThreadTaskRunnerHandle::Get());
53 test::WaitForBookmarkModelToLoad(model_.get()); 53 test::WaitForBookmarkModelToLoad(model_.get());
54 } 54 }
55 55
56 void BookmarkExpandedStateTrackerTest::TearDown() { 56 void BookmarkExpandedStateTrackerTest::TearDown() {
57 model_.reset(); 57 model_.reset();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 tracker->SetExpandedNodes(nodes); 95 tracker->SetExpandedNodes(nodes);
96 // Verify that the node is present. 96 // Verify that the node is present.
97 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); 97 EXPECT_EQ(nodes, tracker->GetExpandedNodes());
98 // Call remove all. 98 // Call remove all.
99 model_->RemoveAllUserBookmarks(); 99 model_->RemoveAllUserBookmarks();
100 // Verify node is not present. 100 // Verify node is not present.
101 EXPECT_TRUE(tracker->GetExpandedNodes().empty()); 101 EXPECT_TRUE(tracker->GetExpandedNodes().empty());
102 } 102 }
103 103
104 } // namespace bookmarks 104 } // namespace bookmarks
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.cc ('k') | components/bookmarks/browser/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698