| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/omnibox/browser/autocomplete_match.h" | 5 #include "components/omnibox/browser/autocomplete_match.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 "https://xn--1lq90ic7f1rc.cn/", false }, | 180 "https://xn--1lq90ic7f1rc.cn/", false }, |
| 181 { L"http://\x89c6 x", "http://xn--1lq90ic7f1rc.cn/", | 181 { L"http://\x89c6 x", "http://xn--1lq90ic7f1rc.cn/", |
| 182 "https://xn--1lq90ic7f1rc.cn/", true }, | 182 "https://xn--1lq90ic7f1rc.cn/", true }, |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 for (size_t i = 0; i < arraysize(cases); ++i) { | 185 for (size_t i = 0; i < arraysize(cases); ++i) { |
| 186 SCOPED_TRACE("input=" + base::WideToUTF8(cases[i].input) + | 186 SCOPED_TRACE("input=" + base::WideToUTF8(cases[i].input) + |
| 187 " url1=" + cases[i].url1 + " url2=" + cases[i].url2); | 187 " url1=" + cases[i].url1 + " url2=" + cases[i].url2); |
| 188 AutocompleteInput input( | 188 AutocompleteInput input( |
| 189 base::WideToUTF16(cases[i].input), base::string16::npos, std::string(), | 189 base::WideToUTF16(cases[i].input), base::string16::npos, std::string(), |
| 190 GURL(), metrics::OmniboxEventProto::INVALID_SPEC, false, false, true, | 190 GURL(), base::string16(), metrics::OmniboxEventProto::INVALID_SPEC, |
| 191 true, false, TestSchemeClassifier()); | 191 false, false, true, true, false, TestSchemeClassifier()); |
| 192 AutocompleteMatch m1(nullptr, 100, false, | 192 AutocompleteMatch m1(nullptr, 100, false, |
| 193 AutocompleteMatchType::URL_WHAT_YOU_TYPED); | 193 AutocompleteMatchType::URL_WHAT_YOU_TYPED); |
| 194 m1.destination_url = GURL(cases[i].url1); | 194 m1.destination_url = GURL(cases[i].url1); |
| 195 m1.ComputeStrippedDestinationURL(input, nullptr); | 195 m1.ComputeStrippedDestinationURL(input, nullptr); |
| 196 AutocompleteMatch m2(nullptr, 100, false, | 196 AutocompleteMatch m2(nullptr, 100, false, |
| 197 AutocompleteMatchType::URL_WHAT_YOU_TYPED); | 197 AutocompleteMatchType::URL_WHAT_YOU_TYPED); |
| 198 m2.destination_url = GURL(cases[i].url2); | 198 m2.destination_url = GURL(cases[i].url2); |
| 199 m2.ComputeStrippedDestinationURL(input, nullptr); | 199 m2.ComputeStrippedDestinationURL(input, nullptr); |
| 200 EXPECT_EQ(cases[i].expected_duplicate, | 200 EXPECT_EQ(cases[i].expected_duplicate, |
| 201 AutocompleteMatch::DestinationsEqual(m1, m2)); | 201 AutocompleteMatch::DestinationsEqual(m1, m2)); |
| 202 } | 202 } |
| 203 } | 203 } |
| OLD | NEW |