| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
| 9 #include "chrome/browser/autocomplete/history_contents_provider.h" | 9 #include "chrome/browser/autocomplete/history_contents_provider.h" |
| 10 #include "chrome/browser/history/history.h" | 10 #include "chrome/browser/history/history.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // We need the ID scope and page ID so that the visit tracker can find it. | 60 // We need the ID scope and page ID so that the visit tracker can find it. |
| 61 // We just use the index for the page ID below. | 61 // We just use the index for the page ID below. |
| 62 const void* id_scope = reinterpret_cast<void*>(1); | 62 const void* id_scope = reinterpret_cast<void*>(1); |
| 63 GURL url(test_entries[i].url); | 63 GURL url(test_entries[i].url); |
| 64 | 64 |
| 65 // Add everything in order of time. We don't want to have a time that | 65 // Add everything in order of time. We don't want to have a time that |
| 66 // is "right now" or it will nondeterministically appear in the results. | 66 // is "right now" or it will nondeterministically appear in the results. |
| 67 Time t = Time::Now() - TimeDelta::FromDays(arraysize(test_entries) + i); | 67 Time t = Time::Now() - TimeDelta::FromDays(arraysize(test_entries) + i); |
| 68 | 68 |
| 69 history_service->AddPage(url, t, id_scope, i, GURL(), | 69 history_service->AddPage(url, t, id_scope, i, GURL(), |
| 70 PageTransition::LINK, HistoryService::RedirectList()); | 70 PageTransition::LINK, HistoryService::RedirectList(), false); |
| 71 history_service->SetPageTitle(url, test_entries[i].title); | 71 history_service->SetPageTitle(url, test_entries[i].title); |
| 72 history_service->SetPageContents(url, test_entries[i].body); | 72 history_service->SetPageContents(url, test_entries[i].body); |
| 73 } | 73 } |
| 74 | 74 |
| 75 provider_ = new HistoryContentsProvider(this, profile_.get()); | 75 provider_ = new HistoryContentsProvider(this, profile_.get()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual void TearDown() { | 78 virtual void TearDown() { |
| 79 provider_ = NULL; | 79 provider_ = NULL; |
| 80 profile_.reset(NULL); | 80 profile_.reset(NULL); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 ASSERT_EQ(2U, m3.size()); | 175 ASSERT_EQ(2U, m3.size()); |
| 176 if (bookmark_url == m3[0].destination_url) { | 176 if (bookmark_url == m3[0].destination_url) { |
| 177 EXPECT_EQ("http://www.google.com/3", m3[1].destination_url.spec()); | 177 EXPECT_EQ("http://www.google.com/3", m3[1].destination_url.spec()); |
| 178 } else { | 178 } else { |
| 179 EXPECT_EQ(bookmark_url, m3[1].destination_url); | 179 EXPECT_EQ(bookmark_url, m3[1].destination_url); |
| 180 EXPECT_EQ("http://www.google.com/3", m3[0].destination_url.spec()); | 180 EXPECT_EQ("http://www.google.com/3", m3[0].destination_url.spec()); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace | 184 } // namespace |
| OLD | NEW |