| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 history_->AddPage(url, test_entries[i].time, id_scope, page_id, GURL(), | 114 history_->AddPage(url, test_entries[i].time, id_scope, page_id, GURL(), |
| 115 content::PAGE_TRANSITION_LINK, history::RedirectList(), | 115 content::PAGE_TRANSITION_LINK, history::RedirectList(), |
| 116 history::SOURCE_BROWSED, false); | 116 history::SOURCE_BROWSED, false); |
| 117 history_->SetPageTitle(url, UTF8ToUTF16(test_entries[i].title)); | 117 history_->SetPageTitle(url, UTF8ToUTF16(test_entries[i].title)); |
| 118 history_->SetPageContents(url, UTF8ToUTF16(test_entries[i].body)); | 118 history_->SetPageContents(url, UTF8ToUTF16(test_entries[i].body)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 virtual void TearDown() { | 122 virtual void TearDown() { |
| 123 if (history_.get()) { | 123 if (history_.get()) { |
| 124 history_->SetOnBackendDestroyTask(new MessageLoop::QuitTask); | 124 history_->SetOnBackendDestroyTask(MessageLoop::QuitClosure); |
| 125 history_->Cleanup(); | 125 history_->Cleanup(); |
| 126 history_ = NULL; | 126 history_ = NULL; |
| 127 MessageLoop::current()->Run(); // Wait for the other thread. | 127 MessageLoop::current()->Run(); // Wait for the other thread. |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 void QueryHistoryComplete(HistoryService::Handle, QueryResults* results) { | 131 void QueryHistoryComplete(HistoryService::Handle, QueryResults* results) { |
| 132 results->Swap(&last_query_results_); | 132 results->Swap(&last_query_results_); |
| 133 MessageLoop::current()->Quit(); // Will return out to QueryHistory. | 133 MessageLoop::current()->Quit(); // Will return out to QueryHistory. |
| 134 } | 134 } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 QueryOptions options; | 344 QueryOptions options; |
| 345 QueryResults results; | 345 QueryResults results; |
| 346 | 346 |
| 347 QueryHistory("Other", options, &results); | 347 QueryHistory("Other", options, &results); |
| 348 EXPECT_EQ(1, results.urls().size()); | 348 EXPECT_EQ(1, results.urls().size()); |
| 349 EXPECT_TRUE(NthResultIs(results, 0, 4)); | 349 EXPECT_TRUE(NthResultIs(results, 0, 4)); |
| 350 } | 350 } |
| 351 */ | 351 */ |
| 352 | 352 |
| 353 } // namespace history | 353 } // namespace history |
| OLD | NEW |