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

Side by Side Diff: chrome/common/pref_names_util_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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
OLDNEW
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/common/pref_names_util.h" 5 #include "chrome/common/pref_names_util.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 10 matching lines...) Expand all
21 21
22 ASSERT_TRUE(pref_names_util::ParseFontNamePrefPath(path, &generic_family, 22 ASSERT_TRUE(pref_names_util::ParseFontNamePrefPath(path, &generic_family,
23 &script)); 23 &script));
24 EXPECT_EQ(expected_generic_family, generic_family); 24 EXPECT_EQ(expected_generic_family, generic_family);
25 EXPECT_EQ(expected_script, script); 25 EXPECT_EQ(expected_script, script);
26 } 26 }
27 27
28 } // namespace 28 } // namespace
29 29
30 TEST(PrefNamesUtilTest, Basic) { 30 TEST(PrefNamesUtilTest, Basic) {
31 ExpectNoParse(""); 31 ExpectNoParse(std::string());
32 ExpectNoParse("."); 32 ExpectNoParse(".");
33 ExpectNoParse("....."); 33 ExpectNoParse(".....");
34 ExpectNoParse("webkit.webprefs.fonts."); 34 ExpectNoParse("webkit.webprefs.fonts.");
35 ExpectNoParse("webkit.webprefs.fonts.."); 35 ExpectNoParse("webkit.webprefs.fonts..");
36 ExpectNoParse("webkit.webprefs.fontsfoobar.standard.Hrkt"); 36 ExpectNoParse("webkit.webprefs.fontsfoobar.standard.Hrkt");
37 ExpectNoParse("foobar.webprefs.fonts.standard.Hrkt"); 37 ExpectNoParse("foobar.webprefs.fonts.standard.Hrkt");
38 ExpectParse("webkit.webprefs.fonts.standard.Hrkt", "standard", "Hrkt"); 38 ExpectParse("webkit.webprefs.fonts.standard.Hrkt", "standard", "Hrkt");
39 ExpectParse("webkit.webprefs.fonts.standard.Hrkt.", "standard", "Hrkt."); 39 ExpectParse("webkit.webprefs.fonts.standard.Hrkt.", "standard", "Hrkt.");
40 ExpectParse("webkit.webprefs.fonts.standard.Hrkt.Foobar", "standard", 40 ExpectParse("webkit.webprefs.fonts.standard.Hrkt.Foobar", "standard",
41 "Hrkt.Foobar"); 41 "Hrkt.Foobar");
42 42
43 // We don't particularly care about the parsed family and script for these 43 // We don't particularly care about the parsed family and script for these
44 // inputs, but just want to make sure it does something reasonable. Returning 44 // inputs, but just want to make sure it does something reasonable. Returning
45 // false may also be an option. 45 // false may also be an option.
46 ExpectParse("webkit.webprefs.fonts...", "", "."); 46 ExpectParse("webkit.webprefs.fonts...", std::string(), ".");
47 ExpectParse("webkit.webprefs.fonts....", "", ".."); 47 ExpectParse("webkit.webprefs.fonts....", std::string(), "..");
48 48
49 // Check that passing NULL output params is okay. 49 // Check that passing NULL output params is okay.
50 EXPECT_TRUE(pref_names_util::ParseFontNamePrefPath( 50 EXPECT_TRUE(pref_names_util::ParseFontNamePrefPath(
51 "webkit.webprefs.fonts.standard.Hrkt", NULL, NULL)); 51 "webkit.webprefs.fonts.standard.Hrkt", NULL, NULL));
52 } 52 }
OLDNEW
« no previous file with comments | « chrome/common/net/x509_certificate_model_nss.cc ('k') | chrome/renderer/autofill/password_autofill_agent_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698