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_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 663 } |
664 } | 664 } |
665 } | 665 } |
666 | 666 |
667 TEST_F(HistoryURLProviderTest, IntranetURLsWithRefs) { | 667 TEST_F(HistoryURLProviderTest, IntranetURLsWithRefs) { |
668 struct TestCase { | 668 struct TestCase { |
669 const char* input; | 669 const char* input; |
670 int relevance; | 670 int relevance; |
671 AutocompleteInput::Type type; | 671 AutocompleteInput::Type type; |
672 } test_cases[] = { | 672 } test_cases[] = { |
673 { "gooey", 1410, AutocompleteInput::UNKNOWN }, | 673 { "gooey", 1410, metrics::OmniboxInputType::UNKNOWN }, |
674 { "gooey/", 1410, AutocompleteInput::URL }, | 674 { "gooey/", 1410, metrics::OmniboxInputType::URL }, |
675 { "gooey#", 1200, AutocompleteInput::UNKNOWN }, | 675 { "gooey#", 1200, metrics::OmniboxInputType::UNKNOWN }, |
676 { "gooey/#", 1200, AutocompleteInput::URL }, | 676 { "gooey/#", 1200, metrics::OmniboxInputType::URL }, |
677 { "gooey#foo", 1200, AutocompleteInput::UNKNOWN }, | 677 { "gooey#foo", 1200, metrics::OmniboxInputType::UNKNOWN }, |
678 { "gooey/#foo", 1200, AutocompleteInput::URL }, | 678 { "gooey/#foo", 1200, metrics::OmniboxInputType::URL }, |
679 { "gooey# foo", 1200, AutocompleteInput::UNKNOWN }, | 679 { "gooey# foo", 1200, metrics::OmniboxInputType::UNKNOWN }, |
680 { "gooey/# foo", 1200, AutocompleteInput::URL }, | 680 { "gooey/# foo", 1200, metrics::OmniboxInputType::URL }, |
681 }; | 681 }; |
682 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { | 682 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { |
683 SCOPED_TRACE(test_cases[i].input); | 683 SCOPED_TRACE(test_cases[i].input); |
684 const UrlAndLegalDefault output[] = { | 684 const UrlAndLegalDefault output[] = { |
685 { URLFixerUpper::FixupURL(test_cases[i].input, std::string()).spec(), | 685 { URLFixerUpper::FixupURL(test_cases[i].input, std::string()).spec(), |
686 true } | 686 true } |
687 }; | 687 }; |
688 AutocompleteInput::Type type; | 688 AutocompleteInput::Type type; |
689 ASSERT_NO_FATAL_FAILURE( | 689 ASSERT_NO_FATAL_FAILURE( |
690 RunTest(ASCIIToUTF16(test_cases[i].input), | 690 RunTest(ASCIIToUTF16(test_cases[i].input), |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 autocomplete_->scoring_params_.experimental_scoring_enabled = true; | 1013 autocomplete_->scoring_params_.experimental_scoring_enabled = true; |
1014 ASSERT_NO_FATAL_FAILURE( | 1014 ASSERT_NO_FATAL_FAILURE( |
1015 RunTest(ASCIIToUTF16(test_cases[i].input), | 1015 RunTest(ASCIIToUTF16(test_cases[i].input), |
1016 base::string16(), false, output, max_matches)); | 1016 base::string16(), false, output, max_matches)); |
1017 for (int j = 0; j < max_matches; ++j) { | 1017 for (int j = 0; j < max_matches; ++j) { |
1018 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, | 1018 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, |
1019 matches_[j].relevance); | 1019 matches_[j].relevance); |
1020 } | 1020 } |
1021 } | 1021 } |
1022 } | 1022 } |
OLD | NEW |