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

Side by Side Diff: chrome/browser/profiles/profile_statistics_unittest.cc

Issue 2523093002: TestBrowserThreads must outlive TestProfiles and TestProfileManagers (Closed)
Patch Set: Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/profiles/profile_statistics.h" 5 #include "chrome/browser/profiles/profile_statistics.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void SetUp() override { 98 void SetUp() override {
99 ASSERT_TRUE(manager_.SetUp()); 99 ASSERT_TRUE(manager_.SetUp());
100 } 100 }
101 101
102 void TearDown() override { 102 void TearDown() override {
103 } 103 }
104 104
105 TestingProfileManager* manager() { return &manager_; } 105 TestingProfileManager* manager() { return &manager_; }
106 106
107 private: 107 private:
108 content::TestBrowserThreadBundle thread_bundle_;
108 TestingProfileManager manager_; 109 TestingProfileManager manager_;
109 content::TestBrowserThreadBundle thread_bundle_;
110 }; 110 };
111 111
112 TEST_F(ProfileStatisticsTest, ProfileAttributesStorage) { 112 TEST_F(ProfileStatisticsTest, ProfileAttributesStorage) {
113 TestingProfile* profile = manager()->CreateTestingProfile("Test 1"); 113 TestingProfile* profile = manager()->CreateTestingProfile("Test 1");
114 ASSERT_TRUE(profile); 114 ASSERT_TRUE(profile);
115 base::FilePath profile_path = profile->GetPath(); 115 base::FilePath profile_path = profile->GetPath();
116 116
117 std::vector<std::string> categories_to_check; 117 std::vector<std::string> categories_to_check;
118 categories_to_check.push_back(profiles::kProfileStatisticsBrowsingHistory); 118 categories_to_check.push_back(profiles::kProfileStatisticsBrowsingHistory);
119 categories_to_check.push_back(profiles::kProfileStatisticsPasswords); 119 categories_to_check.push_back(profiles::kProfileStatisticsPasswords);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 run_loop2.RunUntilIdle(); 176 run_loop2.RunUntilIdle();
177 EXPECT_EQ(0, bookmark_stat_helper.GetNumOfTimesCalled()); 177 EXPECT_EQ(0, bookmark_stat_helper.GetNumOfTimesCalled());
178 178
179 // Load the bookmark model. When the model is loaded (asynchronously), the 179 // Load the bookmark model. When the model is loaded (asynchronously), the
180 // observer added by WaitOrCountBookmarks is run. 180 // observer added by WaitOrCountBookmarks is run.
181 LoadBookmarkModel(profile, bookmark_model); 181 LoadBookmarkModel(profile, bookmark_model);
182 182
183 run_loop_aggregator_destruction.Run(); 183 run_loop_aggregator_destruction.Run();
184 EXPECT_EQ(1, bookmark_stat_helper.GetNumOfTimesCalled()); 184 EXPECT_EQ(1, bookmark_stat_helper.GetNumOfTimesCalled());
185 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698