Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/browser/search/search_unittest.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/rlz/rlz.cc ('k') | chrome/browser/search_engines/template_url_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/rlz/rlz.cc ('k') | chrome/browser/search_engines/template_url_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698