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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 output[max_matches].url = URLFixerUpper::FixupURL( | 999 output[max_matches].url = URLFixerUpper::FixupURL( |
1000 test_cases[i].matches[max_matches].url, std::string()).spec(); | 1000 test_cases[i].matches[max_matches].url, std::string()).spec(); |
1001 output[max_matches].allowed_to_be_default_match = true; | 1001 output[max_matches].allowed_to_be_default_match = true; |
1002 } | 1002 } |
1003 autocomplete_->scoring_params_ = test_cases[i].scoring_params; | 1003 autocomplete_->scoring_params_ = test_cases[i].scoring_params; |
1004 | 1004 |
1005 // Test the control (scoring disabled). | 1005 // Test the control (scoring disabled). |
1006 autocomplete_->scoring_params_.experimental_scoring_enabled = false; | 1006 autocomplete_->scoring_params_.experimental_scoring_enabled = false; |
1007 ASSERT_NO_FATAL_FAILURE( | 1007 ASSERT_NO_FATAL_FAILURE( |
1008 RunTest(ASCIIToUTF16(test_cases[i].input), | 1008 RunTest(ASCIIToUTF16(test_cases[i].input), |
1009 string16(), false, output, max_matches)); | 1009 base::string16(), false, output, max_matches)); |
1010 for (int j = 0; j < max_matches; ++j) { | 1010 for (int j = 0; j < max_matches; ++j) { |
1011 EXPECT_EQ(test_cases[i].matches[j].control_relevance, | 1011 EXPECT_EQ(test_cases[i].matches[j].control_relevance, |
1012 matches_[j].relevance); | 1012 matches_[j].relevance); |
1013 } | 1013 } |
1014 | 1014 |
1015 // Test the experiment (scoring enabled). | 1015 // Test the experiment (scoring enabled). |
1016 autocomplete_->scoring_params_.experimental_scoring_enabled = true; | 1016 autocomplete_->scoring_params_.experimental_scoring_enabled = true; |
1017 ASSERT_NO_FATAL_FAILURE( | 1017 ASSERT_NO_FATAL_FAILURE( |
1018 RunTest(ASCIIToUTF16(test_cases[i].input), | 1018 RunTest(ASCIIToUTF16(test_cases[i].input), |
1019 string16(), false, output, max_matches)); | 1019 base::string16(), false, output, max_matches)); |
1020 for (int j = 0; j < max_matches; ++j) { | 1020 for (int j = 0; j < max_matches; ++j) { |
1021 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, | 1021 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, |
1022 matches_[j].relevance); | 1022 matches_[j].relevance); |
1023 } | 1023 } |
1024 } | 1024 } |
1025 } | 1025 } |
OLD | NEW |