OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 100 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
101 CreateHistory(); | 101 CreateHistory(); |
102 } | 102 } |
103 void TearDown() override { | 103 void TearDown() override { |
104 Flush(); | 104 Flush(); |
105 } | 105 } |
106 | 106 |
107 void CreateHistory() { | 107 void CreateHistory() { |
108 const char kStoreDataFileName[] = "app-launcher-test"; | 108 const char kStoreDataFileName[] = "app-launcher-test"; |
109 const base::FilePath data_file = | 109 const base::FilePath data_file = |
110 temp_dir_.path().AppendASCII(kStoreDataFileName); | 110 temp_dir_.GetPath().AppendASCII(kStoreDataFileName); |
111 scoped_refptr<DictionaryDataStore> dictionary_data_store( | 111 scoped_refptr<DictionaryDataStore> dictionary_data_store( |
112 new DictionaryDataStore(data_file, worker_pool_owner_->pool().get())); | 112 new DictionaryDataStore(data_file, worker_pool_owner_->pool().get())); |
113 history_.reset(new History(scoped_refptr<HistoryDataStore>( | 113 history_.reset(new History(scoped_refptr<HistoryDataStore>( |
114 new HistoryDataStore(dictionary_data_store)))); | 114 new HistoryDataStore(dictionary_data_store)))); |
115 | 115 |
116 // Replace |data_| with test params. | 116 // Replace |data_| with test params. |
117 history_->data_->RemoveObserver(history_.get()); | 117 history_->data_->RemoveObserver(history_.get()); |
118 history_->data_.reset( | 118 history_->data_.reset( |
119 new HistoryData(history_->store_.get(), kMaxPrimary, kMaxSecondary)); | 119 new HistoryData(history_->store_.get(), kMaxPrimary, kMaxSecondary)); |
120 history_->data_->AddObserver(history_.get()); | 120 history_->data_->AddObserver(history_.get()); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 // The oldest secondary is gone. | 297 // The oldest secondary is gone. |
298 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); | 298 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); |
299 | 299 |
300 // Touched oldest survived. | 300 // Touched oldest survived. |
301 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); | 301 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); |
302 } | 302 } |
303 | 303 |
304 } // namespace test | 304 } // namespace test |
305 } // namespace app_list | 305 } // namespace app_list |
OLD | NEW |