| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
| 7 #include "base/metrics/histogram_base.h" | 7 #include "base/metrics/histogram_base.h" |
| 8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 {"https://foo.com/instant?strk", "", "Invalid search url"}, | 820 {"https://foo.com/instant?strk", "", "Invalid search url"}, |
| 821 {"https://foo.com/instant#strk", "", "Invalid search url"}, | 821 {"https://foo.com/instant#strk", "", "Invalid search url"}, |
| 822 {"https://foo.com/alt#quux=foo", "foo", "Valid search url"}, | 822 {"https://foo.com/alt#quux=foo", "foo", "Valid search url"}, |
| 823 {"https://foo.com/alt#quux=foo&strk", "foo", "Valid search url"} | 823 {"https://foo.com/alt#quux=foo&strk", "foo", "Valid search url"} |
| 824 }; | 824 }; |
| 825 | 825 |
| 826 for (size_t i = 0; i < arraysize(kTestCases); ++i) { | 826 for (size_t i = 0; i < arraysize(kTestCases); ++i) { |
| 827 const ExtractSearchTermsTestCase& test = kTestCases[i]; | 827 const ExtractSearchTermsTestCase& test = kTestCases[i]; |
| 828 EXPECT_EQ( | 828 EXPECT_EQ( |
| 829 test.expected_result, | 829 test.expected_result, |
| 830 UTF16ToASCII(chrome::ExtractSearchTermsFromURL(profile(), | 830 base::UTF16ToASCII(chrome::ExtractSearchTermsFromURL(profile(), |
| 831 GURL(test.url)))) | 831 GURL(test.url)))) |
| 832 << test.url << " " << test.comment; | 832 << test.url << " " << test.comment; |
| 833 } | 833 } |
| 834 } | 834 } |
| 835 | 835 |
| 836 struct QueryExtractionAllowedTestCase { | 836 struct QueryExtractionAllowedTestCase { |
| 837 const char* url; | 837 const char* url; |
| 838 bool expected_result; | 838 bool expected_result; |
| 839 const char* comment; | 839 const char* comment; |
| 840 }; | 840 }; |
| 841 | 841 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 TEST_F(OriginChipV2Test, CommandLineHideOnUserInput) { | 1236 TEST_F(OriginChipV2Test, CommandLineHideOnUserInput) { |
| 1237 CommandLine::ForCurrentProcess()->AppendSwitch( | 1237 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1238 switches::kEnableOriginChipV2HideOnUserInput); | 1238 switches::kEnableOriginChipV2HideOnUserInput); |
| 1239 EXPECT_TRUE(ShouldDisplayOriginChipV2()); | 1239 EXPECT_TRUE(ShouldDisplayOriginChipV2()); |
| 1240 EXPECT_EQ(ORIGIN_CHIP_V2_HIDE_ON_USER_INPUT, GetOriginChipV2HideTrigger()); | 1240 EXPECT_EQ(ORIGIN_CHIP_V2_HIDE_ON_USER_INPUT, GetOriginChipV2HideTrigger()); |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 } // namespace chrome | 1243 } // namespace chrome |
| OLD | NEW |