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/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 prefs.FindPreference(prefs::kCloudPrintProxyEnabled); | 39 prefs.FindPreference(prefs::kCloudPrintProxyEnabled); |
40 ASSERT_TRUE(pref); | 40 ASSERT_TRUE(pref); |
41 const base::Value* value = pref->GetValue(); | 41 const base::Value* value = pref->GetValue(); |
42 ASSERT_TRUE(value); | 42 ASSERT_TRUE(value); |
43 EXPECT_EQ(base::Value::TYPE_BOOLEAN, value->GetType()); | 43 EXPECT_EQ(base::Value::TYPE_BOOLEAN, value->GetType()); |
44 bool actual_bool_value = true; | 44 bool actual_bool_value = true; |
45 EXPECT_TRUE(value->GetAsBoolean(&actual_bool_value)); | 45 EXPECT_TRUE(value->GetAsBoolean(&actual_bool_value)); |
46 EXPECT_FALSE(actual_bool_value); | 46 EXPECT_FALSE(actual_bool_value); |
47 | 47 |
48 // Change the command line. | 48 // Change the command line. |
49 CommandLine cmd_line(CommandLine::NO_PROGRAM); | 49 base::CommandLine cmd_line(base::CommandLine::NO_PROGRAM); |
50 cmd_line.AppendSwitch(switches::kEnableCloudPrintProxy); | 50 cmd_line.AppendSwitch(switches::kEnableCloudPrintProxy); |
51 | 51 |
52 // Call UpdateCommandLinePrefStore and check to see if the value has changed. | 52 // Call UpdateCommandLinePrefStore and check to see if the value has changed. |
53 prefs.UpdateCommandLinePrefStore(new CommandLinePrefStore(&cmd_line)); | 53 prefs.UpdateCommandLinePrefStore(new CommandLinePrefStore(&cmd_line)); |
54 pref = prefs.FindPreference(prefs::kCloudPrintProxyEnabled); | 54 pref = prefs.FindPreference(prefs::kCloudPrintProxyEnabled); |
55 ASSERT_TRUE(pref); | 55 ASSERT_TRUE(pref); |
56 value = pref->GetValue(); | 56 value = pref->GetValue(); |
57 ASSERT_TRUE(value); | 57 ASSERT_TRUE(value); |
58 EXPECT_EQ(base::Value::TYPE_BOOLEAN, value->GetType()); | 58 EXPECT_EQ(base::Value::TYPE_BOOLEAN, value->GetType()); |
59 actual_bool_value = false; | 59 actual_bool_value = false; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 const char kDefaultFont[] = "Times"; | 130 const char kDefaultFont[] = "Times"; |
131 #elif defined(OS_CHROMEOS) | 131 #elif defined(OS_CHROMEOS) |
132 const char kDefaultFont[] = "Tinos"; | 132 const char kDefaultFont[] = "Tinos"; |
133 #else | 133 #else |
134 const char kDefaultFont[] = "Times New Roman"; | 134 const char kDefaultFont[] = "Times New Roman"; |
135 #endif | 135 #endif |
136 EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont), | 136 EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont), |
137 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); | 137 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); |
138 EXPECT_TRUE(webkit_prefs.javascript_enabled); | 138 EXPECT_TRUE(webkit_prefs.javascript_enabled); |
139 } | 139 } |
OLD | NEW |