OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 for (size_t i = 0; i < arraysize(test_entries); i++) { | 105 for (size_t i = 0; i < arraysize(test_entries); i++) { |
106 test_entries[i].time = | 106 test_entries[i].time = |
107 now - (test_entries[i].days_ago * TimeDelta::FromDays(1)); | 107 now - (test_entries[i].days_ago * TimeDelta::FromDays(1)); |
108 | 108 |
109 // We need the ID scope and page ID so that the visit tracker can find it. | 109 // We need the ID scope and page ID so that the visit tracker can find it. |
110 const void* id_scope = reinterpret_cast<void*>(1); | 110 const void* id_scope = reinterpret_cast<void*>(1); |
111 int32 page_id = i; | 111 int32 page_id = i; |
112 GURL url(test_entries[i].url); | 112 GURL url(test_entries[i].url); |
113 | 113 |
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 history::RedirectList(), content::PAGE_TRANSITION_LINK, |
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(MessageLoop::QuitClosure()); | 124 history_->SetOnBackendDestroyTask(MessageLoop::QuitClosure()); |
125 history_->Cleanup(); | 125 history_->Cleanup(); |
(...skipping 218 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 |