Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: chrome/browser/history/in_memory_url_index_unittest.cc

Issue 7618028: Tweak typed-count Usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include <fstream> 7 #include <fstream>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 // A search for 'working' should not short-circuit. 290 // A search for 'working' should not short-circuit.
291 matches = url_index_->HistoryItemsForTerms(Make1Term("working")); 291 matches = url_index_->HistoryItemsForTerms(Make1Term("working"));
292 EXPECT_EQ(1U, matches.size()); 292 EXPECT_EQ(1U, matches.size());
293 } 293 }
294 294
295 TEST_F(InMemoryURLIndexTest, TitleSearch) { 295 TEST_F(InMemoryURLIndexTest, TitleSearch) {
296 url_index_.reset(new InMemoryURLIndex()); 296 url_index_.reset(new InMemoryURLIndex());
297 url_index_->Init(this, "en,ja,hi,zh"); 297 url_index_->Init(this, "en,ja,hi,zh");
298 // Signal if someone has changed the test DB. 298 // Signal if someone has changed the test DB.
299 EXPECT_EQ(25U, url_index_->history_info_map_.size()); 299 EXPECT_EQ(27U, url_index_->history_info_map_.size());
300 InMemoryURLIndex::String16Vector terms; 300 InMemoryURLIndex::String16Vector terms;
301 301
302 // Ensure title is being searched. 302 // Ensure title is being searched.
303 terms.push_back(ASCIIToUTF16("MORTGAGE")); 303 terms.push_back(ASCIIToUTF16("MORTGAGE"));
304 terms.push_back(ASCIIToUTF16("RATE")); 304 terms.push_back(ASCIIToUTF16("RATE"));
305 terms.push_back(ASCIIToUTF16("DROPS")); 305 terms.push_back(ASCIIToUTF16("DROPS"));
306 ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms(terms); 306 ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms(terms);
307 ASSERT_EQ(1U, matches.size()); 307 ASSERT_EQ(1U, matches.size());
308 308
309 // Verify that we got back the result we expected. 309 // Verify that we got back the result we expected.
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 const URLRow& expected_row(expected->second); 770 const URLRow& expected_row(expected->second);
771 const URLRow& actual_row(actual->second); 771 const URLRow& actual_row(actual->second);
772 EXPECT_EQ(expected_row.visit_count(), actual_row.visit_count()); 772 EXPECT_EQ(expected_row.visit_count(), actual_row.visit_count());
773 EXPECT_EQ(expected_row.typed_count(), actual_row.typed_count()); 773 EXPECT_EQ(expected_row.typed_count(), actual_row.typed_count());
774 EXPECT_EQ(expected_row.last_visit(), actual_row.last_visit()); 774 EXPECT_EQ(expected_row.last_visit(), actual_row.last_visit());
775 EXPECT_EQ(expected_row.url(), actual_row.url()); 775 EXPECT_EQ(expected_row.url(), actual_row.url());
776 } 776 }
777 } 777 }
778 778
779 } // namespace history 779 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/history_types_unittest.cc ('k') | chrome/browser/history/url_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698