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

Side by Side Diff: chrome/browser/autocomplete/in_memory_url_index_unittest.cc

Issue 1105373002: Add task runners to more tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstRunBubbleTest.CreateAndClose Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <fstream> 6 #include <fstream>
7 7
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 InMemoryURLIndexCacheTest() {} 1198 InMemoryURLIndexCacheTest() {}
1199 1199
1200 protected: 1200 protected:
1201 void SetUp() override; 1201 void SetUp() override;
1202 void TearDown() override; 1202 void TearDown() override;
1203 1203
1204 // Pass-through functions to simplify our friendship with InMemoryURLIndex. 1204 // Pass-through functions to simplify our friendship with InMemoryURLIndex.
1205 void set_history_dir(const base::FilePath& dir_path); 1205 void set_history_dir(const base::FilePath& dir_path);
1206 bool GetCacheFilePath(base::FilePath* file_path) const; 1206 bool GetCacheFilePath(base::FilePath* file_path) const;
1207 1207
1208 content::TestBrowserThreadBundle thread_bundle_;
1208 base::ScopedTempDir temp_dir_; 1209 base::ScopedTempDir temp_dir_;
1209 scoped_ptr<InMemoryURLIndex> url_index_; 1210 scoped_ptr<InMemoryURLIndex> url_index_;
1210 }; 1211 };
1211 1212
1212 void InMemoryURLIndexCacheTest::SetUp() { 1213 void InMemoryURLIndexCacheTest::SetUp() {
1213 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 1214 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
1214 base::FilePath path(temp_dir_.path()); 1215 base::FilePath path(temp_dir_.path());
1215 url_index_.reset( 1216 url_index_.reset(
1216 new InMemoryURLIndex(nullptr, nullptr, path, kTestLanguages)); 1217 new InMemoryURLIndex(nullptr, nullptr, path, kTestLanguages));
1217 } 1218 }
(...skipping 23 matching lines...) Expand all
1241 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); 1242 ASSERT_TRUE(GetCacheFilePath(&full_file_path));
1242 std::vector<base::FilePath::StringType> actual_parts; 1243 std::vector<base::FilePath::StringType> actual_parts;
1243 full_file_path.GetComponents(&actual_parts); 1244 full_file_path.GetComponents(&actual_parts);
1244 ASSERT_EQ(expected_parts.size(), actual_parts.size()); 1245 ASSERT_EQ(expected_parts.size(), actual_parts.size());
1245 size_t count = expected_parts.size(); 1246 size_t count = expected_parts.size();
1246 for (size_t i = 0; i < count; ++i) 1247 for (size_t i = 0; i < count; ++i)
1247 EXPECT_EQ(expected_parts[i], actual_parts[i]); 1248 EXPECT_EQ(expected_parts[i], actual_parts[i]);
1248 // Must clear the history_dir_ to satisfy the dtor's DCHECK. 1249 // Must clear the history_dir_ to satisfy the dtor's DCHECK.
1249 set_history_dir(base::FilePath()); 1250 set_history_dir(base::FilePath());
1250 } 1251 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698