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

Side by Side Diff: chrome/browser/ui/app_list/search/history_unittest.cc

Issue 1496493004: Revert of Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // testing::Test overrides: 93 // testing::Test overrides:
94 void SetUp() override { 94 void SetUp() override {
95 worker_pool_owner_.reset( 95 worker_pool_owner_.reset(
96 new base::SequencedWorkerPoolOwner(1, "AppLauncherTest")); 96 new base::SequencedWorkerPoolOwner(1, "AppLauncherTest"));
97 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 97 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
98 CreateHistory(); 98 CreateHistory();
99 } 99 }
100 void TearDown() override { 100 void TearDown() override {
101 Flush(); 101 Flush();
102 worker_pool_owner_->pool()->Shutdown();
102 } 103 }
103 104
104 void CreateHistory() { 105 void CreateHistory() {
105 const char kStoreDataFileName[] = "app-launcher-test"; 106 const char kStoreDataFileName[] = "app-launcher-test";
106 const base::FilePath data_file = 107 const base::FilePath data_file =
107 temp_dir_.path().AppendASCII(kStoreDataFileName); 108 temp_dir_.path().AppendASCII(kStoreDataFileName);
108 scoped_refptr<DictionaryDataStore> dictionary_data_store( 109 scoped_refptr<DictionaryDataStore> dictionary_data_store(
109 new DictionaryDataStore(data_file, worker_pool_owner_->pool().get())); 110 new DictionaryDataStore(data_file, worker_pool_owner_->pool().get()));
110 history_.reset(new History(scoped_refptr<HistoryDataStore>( 111 history_.reset(new History(scoped_refptr<HistoryDataStore>(
111 new HistoryDataStore(dictionary_data_store)))); 112 new HistoryDataStore(dictionary_data_store))));
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 294
294 // The oldest secondary is gone. 295 // The oldest secondary is gone.
295 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); 296 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1"));
296 297
297 // Touched oldest survived. 298 // Touched oldest survived.
298 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); 299 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0"));
299 } 300 }
300 301
301 } // namespace test 302 } // namespace test
302 } // namespace app_list 303 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698