| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 virtual void TearDown() OVERRIDE { | 120 virtual void TearDown() OVERRIDE { |
| 121 Flush(); | 121 Flush(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void CreateHistory() { | 124 void CreateHistory() { |
| 125 history_.reset(new History(profile_.get())); | 125 history_.reset(new History(profile_.get())); |
| 126 | 126 |
| 127 // Replace |data_| with test params. | 127 // Replace |data_| with test params. |
| 128 history_->data_->RemoveObserver(history_.get()); | 128 history_->data_->RemoveObserver(history_.get()); |
| 129 history_->data_.reset(new HistoryData(history_->store_, | 129 history_->data_.reset( |
| 130 kMaxPrimary, | 130 new HistoryData(history_->store_.get(), kMaxPrimary, kMaxSecondary)); |
| 131 kMaxSecondary)); | |
| 132 history_->data_->AddObserver(history_.get()); | 131 history_->data_->AddObserver(history_.get()); |
| 133 | 132 |
| 134 HistoryDataLoadWaiter waiter(history_->data_.get()); | 133 HistoryDataLoadWaiter waiter(history_->data_.get()); |
| 135 waiter.Wait(1000); | 134 waiter.Wait(1000); |
| 136 ASSERT_TRUE(history_->IsReady()); | 135 ASSERT_TRUE(history_->IsReady()); |
| 137 } | 136 } |
| 138 | 137 |
| 139 void Flush() { | 138 void Flush() { |
| 140 StoreFlushWaiter waiter(history_->store_.get()); | 139 StoreFlushWaiter waiter(history_->store_.get()); |
| 141 waiter.Wait(1000); | 140 waiter.Wait(1000); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 309 |
| 311 // The oldest secondary is gone. | 310 // The oldest secondary is gone. |
| 312 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); | 311 EXPECT_EQ(UNKNOWN_RESULT, GetResultType("1")); |
| 313 | 312 |
| 314 // Touched oldest survived. | 313 // Touched oldest survived. |
| 315 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); | 314 EXPECT_EQ(PERFECT_SECONDARY, GetResultType("0")); |
| 316 } | 315 } |
| 317 | 316 |
| 318 } // namespace test | 317 } // namespace test |
| 319 } // namespace app_list | 318 } // namespace app_list |
| OLD | NEW |