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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/history/scored_history_match.h" | 10 #include "chrome/browser/history/scored_history_match.h" |
11 #include "components/bookmarks/core/browser/bookmark_service.h" | 11 #include "components/bookmarks/browser/bookmark_service.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using base::ASCIIToUTF16; | 14 using base::ASCIIToUTF16; |
15 | 15 |
16 namespace history { | 16 namespace history { |
17 | 17 |
18 // Returns a VisitInfoVector that includes |num_visits| spread over the | 18 // Returns a VisitInfoVector that includes |num_visits| spread over the |
19 // last |frequency|*|num_visits| days (relative to |now|). A frequency of | 19 // last |frequency|*|num_visits| days (relative to |now|). A frequency of |
20 // one means one visit each day, two means every other day, etc. | 20 // one means one visit each day, two means every other day, etc. |
21 VisitInfoVector CreateVisitInfoVector(int num_visits, | 21 VisitInfoVector CreateVisitInfoVector(int num_visits, |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // Finally, verify that protocol matches and top level domain name | 440 // Finally, verify that protocol matches and top level domain name |
441 // matches (.com, .net, etc.) score worse than some of the mid-word | 441 // matches (.com, .net, etc.) score worse than some of the mid-word |
442 // matches that actually count. | 442 // matches that actually count. |
443 EXPECT_GT(hostname_mid_word_score, protocol_score); | 443 EXPECT_GT(hostname_mid_word_score, protocol_score); |
444 EXPECT_GT(hostname_mid_word_score, protocol_mid_word_score); | 444 EXPECT_GT(hostname_mid_word_score, protocol_mid_word_score); |
445 EXPECT_GT(hostname_mid_word_score, tld_score); | 445 EXPECT_GT(hostname_mid_word_score, tld_score); |
446 EXPECT_GT(hostname_mid_word_score, tld_mid_word_score); | 446 EXPECT_GT(hostname_mid_word_score, tld_mid_word_score); |
447 } | 447 } |
448 | 448 |
449 } // namespace history | 449 } // namespace history |
OLD | NEW |