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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 HistoryDataLoadWaiter(history_->data_.get()).Wait(); | 121 HistoryDataLoadWaiter(history_->data_.get()).Wait(); |
122 ASSERT_TRUE(history_->IsReady()); | 122 ASSERT_TRUE(history_->IsReady()); |
123 } | 123 } |
124 | 124 |
125 void Flush() { | 125 void Flush() { |
126 StoreFlushWaiter(history_->store_.get()).Wait(); | 126 StoreFlushWaiter(history_->store_.get()).Wait(); |
127 } | 127 } |
128 | 128 |
129 size_t GetKnownResults(const std::string& query) { | 129 size_t GetKnownResults(const std::string& query) { |
130 known_results_ = history()->GetKnownResults(query).Pass(); | 130 known_results_ = history()->GetKnownResults(query); |
131 return known_results_->size(); | 131 return known_results_->size(); |
132 } | 132 } |
133 | 133 |
134 KnownResultType GetResultType(const std::string& result_id) { | 134 KnownResultType GetResultType(const std::string& result_id) { |
135 return known_results_->find(result_id) != known_results_->end() | 135 return known_results_->find(result_id) != known_results_->end() |
136 ? (*known_results_.get())[result_id] | 136 ? (*known_results_.get())[result_id] |
137 : UNKNOWN_RESULT; | 137 : UNKNOWN_RESULT; |
138 } | 138 } |
139 | 139 |
140 History* history() { return history_.get(); } | 140 History* history() { return history_.get(); } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 // The oldest secondary is gone. | 296 // The oldest secondary is gone. |
297 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); | 297 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); |
298 | 298 |
299 // Touched oldest survived. | 299 // Touched oldest survived. |
300 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); | 300 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); |
301 } | 301 } |
302 | 302 |
303 } // namespace test | 303 } // namespace test |
304 } // namespace app_list | 304 } // namespace app_list |
OLD | NEW |