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 "chrome/browser/autocomplete/history_quick_provider.h" | 5 #include "chrome/browser/autocomplete/history_quick_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Add visits. | 235 // Add visits. |
236 for (int j = 0; j < cur.visit_count; ++j) { | 236 for (int j = 0; j < cur.visit_count; ++j) { |
237 // Assume earlier visits are at one-day intervals. | 237 // Assume earlier visits are at one-day intervals. |
238 visit_time -= TimeDelta::FromDays(1); | 238 visit_time -= TimeDelta::FromDays(1); |
239 transaction.Begin(); | 239 transaction.Begin(); |
240 // Mark the most recent |cur.typed_count| visits as typed. | 240 // Mark the most recent |cur.typed_count| visits as typed. |
241 std::string sql_cmd_line = base::StringPrintf( | 241 std::string sql_cmd_line = base::StringPrintf( |
242 "INSERT INTO \"visits\" VALUES(%" PRIuS ", %" PRIuS ", %" PRId64 | 242 "INSERT INTO \"visits\" VALUES(%" PRIuS ", %" PRIuS ", %" PRId64 |
243 ", 0, %d, 0, 1)", | 243 ", 0, %d, 0, 1)", |
244 visit_id++, i + 1, visit_time.ToInternalValue(), | 244 visit_id++, i + 1, visit_time.ToInternalValue(), |
245 (j < cur.typed_count) ? content::PAGE_TRANSITION_TYPED : | 245 (j < cur.typed_count) ? ui::PAGE_TRANSITION_TYPED : |
246 content::PAGE_TRANSITION_LINK); | 246 ui::PAGE_TRANSITION_LINK); |
247 | 247 |
248 sql::Statement sql_stmt(db.GetUniqueStatement(sql_cmd_line.c_str())); | 248 sql::Statement sql_stmt(db.GetUniqueStatement(sql_cmd_line.c_str())); |
249 EXPECT_TRUE(sql_stmt.Run()); | 249 EXPECT_TRUE(sql_stmt.Run()); |
250 transaction.Commit(); | 250 transaction.Commit(); |
251 } | 251 } |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 HistoryQuickProviderTest::SetShouldContain::SetShouldContain( | 255 HistoryQuickProviderTest::SetShouldContain::SetShouldContain( |
256 const ACMatches& matched_urls) { | 256 const ACMatches& matched_urls) { |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 | 775 |
776 TEST_F(HQPOrderingTest, TEAMatch) { | 776 TEST_F(HQPOrderingTest, TEAMatch) { |
777 std::vector<std::string> expected_urls; | 777 std::vector<std::string> expected_urls; |
778 expected_urls.push_back("http://www.teamliquid.net/"); | 778 expected_urls.push_back("http://www.teamliquid.net/"); |
779 expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 779 expected_urls.push_back("http://www.teamliquid.net/tlpd"); |
780 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 780 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |
781 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, | 781 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, |
782 ASCIIToUTF16("www.teamliquid.net"), | 782 ASCIIToUTF16("www.teamliquid.net"), |
783 ASCIIToUTF16("mliquid.net")); | 783 ASCIIToUTF16("mliquid.net")); |
784 } | 784 } |
OLD | NEW |