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

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

Issue 1417353006: Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust formatting and rebase 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();
103 } 102 }
104 103
105 void CreateHistory() { 104 void CreateHistory() {
106 const char kStoreDataFileName[] = "app-launcher-test"; 105 const char kStoreDataFileName[] = "app-launcher-test";
107 const base::FilePath data_file = 106 const base::FilePath data_file =
108 temp_dir_.path().AppendASCII(kStoreDataFileName); 107 temp_dir_.path().AppendASCII(kStoreDataFileName);
109 scoped_refptr<DictionaryDataStore> dictionary_data_store( 108 scoped_refptr<DictionaryDataStore> dictionary_data_store(
110 new DictionaryDataStore(data_file, worker_pool_owner_->pool().get())); 109 new DictionaryDataStore(data_file, worker_pool_owner_->pool().get()));
111 history_.reset(new History(scoped_refptr<HistoryDataStore>( 110 history_.reset(new History(scoped_refptr<HistoryDataStore>(
112 new HistoryDataStore(dictionary_data_store)))); 111 new HistoryDataStore(dictionary_data_store))));
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 293
295 // The oldest secondary is gone. 294 // The oldest secondary is gone.
296 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); 295 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1"));
297 296
298 // Touched oldest survived. 297 // Touched oldest survived.
299 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); 298 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0"));
300 } 299 }
301 300
302 } // namespace test 301 } // namespace test
303 } // namespace app_list 302 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698