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 <fstream> | 5 #include <fstream> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // The results should have a poor score. | 268 // The results should have a poor score. |
269 EXPECT_LT(matches[0].raw_score, 500); | 269 EXPECT_LT(matches[0].raw_score, 500); |
270 EXPECT_EQ(33, matches[0].url_info.id()); | 270 EXPECT_EQ(33, matches[0].url_info.id()); |
271 EXPECT_EQ("http://quiteuselesssearchresultxyz.com/", | 271 EXPECT_EQ("http://quiteuselesssearchresultxyz.com/", |
272 matches[0].url_info.url().spec()); // Note: URL gets lowercased. | 272 matches[0].url_info.url().spec()); // Note: URL gets lowercased. |
273 EXPECT_EQ(ASCIIToUTF16("Practically Useless Search Result"), | 273 EXPECT_EQ(ASCIIToUTF16("Practically Useless Search Result"), |
274 matches[0].url_info.title()); | 274 matches[0].url_info.title()); |
275 EXPECT_FALSE(matches[0].can_inline); | 275 EXPECT_FALSE(matches[0].can_inline); |
276 | 276 |
277 // Search which will match at the end of an URL with encoded characters. | 277 // Search which will match at the end of an URL with encoded characters. |
278 matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ice")); | 278 matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("Mice")); |
279 ASSERT_EQ(1U, matches.size()); | 279 ASSERT_EQ(1U, matches.size()); |
| 280 EXPECT_EQ(30, matches[0].url_info.id()); |
280 EXPECT_FALSE(matches[0].can_inline); | 281 EXPECT_FALSE(matches[0].can_inline); |
281 | 282 |
282 // Verify that a single term can appear multiple times in the URL and as long | 283 // Verify that a single term can appear multiple times in the URL and as long |
283 // as one starts the URL it is still inlined. | 284 // as one starts the URL it is still inlined. |
284 matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("fubar")); | 285 matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("fubar")); |
285 ASSERT_EQ(1U, matches.size()); | 286 ASSERT_EQ(1U, matches.size()); |
286 EXPECT_EQ(34, matches[0].url_info.id()); | 287 EXPECT_EQ(34, matches[0].url_info.id()); |
287 EXPECT_EQ("http://fubarfubarandfubar.com/", matches[0].url_info.url().spec()); | 288 EXPECT_EQ("http://fubarfubarandfubar.com/", matches[0].url_info.url().spec()); |
288 EXPECT_EQ(ASCIIToUTF16("Situation Normal -- FUBARED"), | 289 EXPECT_EQ(ASCIIToUTF16("Situation Normal -- FUBARED"), |
289 matches[0].url_info.title()); | 290 matches[0].url_info.title()); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 const URLRow& expected_row(expected->second); | 791 const URLRow& expected_row(expected->second); |
791 const URLRow& actual_row(actual->second); | 792 const URLRow& actual_row(actual->second); |
792 EXPECT_EQ(expected_row.visit_count(), actual_row.visit_count()); | 793 EXPECT_EQ(expected_row.visit_count(), actual_row.visit_count()); |
793 EXPECT_EQ(expected_row.typed_count(), actual_row.typed_count()); | 794 EXPECT_EQ(expected_row.typed_count(), actual_row.typed_count()); |
794 EXPECT_EQ(expected_row.last_visit(), actual_row.last_visit()); | 795 EXPECT_EQ(expected_row.last_visit(), actual_row.last_visit()); |
795 EXPECT_EQ(expected_row.url(), actual_row.url()); | 796 EXPECT_EQ(expected_row.url(), actual_row.url()); |
796 } | 797 } |
797 } | 798 } |
798 | 799 |
799 } // namespace history | 800 } // namespace history |
OLD | NEW |