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

Side by Side Diff: chrome/browser/locale_tests_uitest.cc

Issue 3069014: Convert a bunch of easy AppendSwitchWithValue to *ASCII. (Closed)
Patch Set: fix Created 10 years, 4 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 class LocaleTestsBase : public UITest { 9 class LocaleTestsBase : public UITest {
10 public: 10 public:
(...skipping 11 matching lines...) Expand all
22 #endif 22 #endif
23 }; 23 };
24 24
25 const char* old_lc_all_; 25 const char* old_lc_all_;
26 }; 26 };
27 27
28 28
29 class LocaleTestsDa : public LocaleTestsBase { 29 class LocaleTestsDa : public LocaleTestsBase {
30 public: 30 public:
31 LocaleTestsDa() : LocaleTestsBase() { 31 LocaleTestsDa() : LocaleTestsBase() {
32 launch_arguments_.AppendSwitchWithValue("lang", "da"); 32 launch_arguments_.AppendSwitchASCII("lang", "da");
33 33
34 // Linux doesn't use --lang, it only uses environment variables to set the 34 // Linux doesn't use --lang, it only uses environment variables to set the
35 // language. 35 // language.
36 #if defined(OS_LINUX) 36 #if defined(OS_LINUX)
37 old_lc_all_ = getenv("LC_ALL"); 37 old_lc_all_ = getenv("LC_ALL");
38 setenv("LC_ALL", "da_DK.UTF-8", 1); 38 setenv("LC_ALL", "da_DK.UTF-8", 1);
39 #endif 39 #endif
40 } 40 }
41 }; 41 };
42 42
43 class LocaleTestsHe : public LocaleTestsBase { 43 class LocaleTestsHe : public LocaleTestsBase {
44 public: 44 public:
45 LocaleTestsHe() : LocaleTestsBase() { 45 LocaleTestsHe() : LocaleTestsBase() {
46 launch_arguments_.AppendSwitchWithValue("lang", "he"); 46 launch_arguments_.AppendSwitchASCII("lang", "he");
47 #if defined(OS_LINUX) 47 #if defined(OS_LINUX)
48 old_lc_all_ = getenv("LC_ALL"); 48 old_lc_all_ = getenv("LC_ALL");
49 setenv("LC_ALL", "he_IL.UTF-8", 1); 49 setenv("LC_ALL", "he_IL.UTF-8", 1);
50 #endif 50 #endif
51 } 51 }
52 }; 52 };
53 53
54 class LocaleTestsZhTw : public LocaleTestsBase { 54 class LocaleTestsZhTw : public LocaleTestsBase {
55 public: 55 public:
56 LocaleTestsZhTw() : LocaleTestsBase() { 56 LocaleTestsZhTw() : LocaleTestsBase() {
57 launch_arguments_.AppendSwitchWithValue("lang", "zh-TW"); 57 launch_arguments_.AppendSwitchASCII("lang", "zh-TW");
58 #if defined(OS_LINUX) 58 #if defined(OS_LINUX)
59 old_lc_all_ = getenv("LC_ALL"); 59 old_lc_all_ = getenv("LC_ALL");
60 setenv("LC_ALL", "zh_TW.UTF-8", 1); 60 setenv("LC_ALL", "zh_TW.UTF-8", 1);
61 #endif 61 #endif
62 } 62 }
63 }; 63 };
64 64
65 TEST_F(LocaleTestsDa, TestStart) { 65 TEST_F(LocaleTestsDa, TestStart) {
66 // Just making sure we can start/shutdown cleanly. 66 // Just making sure we can start/shutdown cleanly.
67 RestoreLcAllEnvironment(); 67 RestoreLcAllEnvironment();
68 } 68 }
69 69
70 TEST_F(LocaleTestsHe, TestStart) { 70 TEST_F(LocaleTestsHe, TestStart) {
71 // Just making sure we can start/shutdown cleanly. 71 // Just making sure we can start/shutdown cleanly.
72 RestoreLcAllEnvironment(); 72 RestoreLcAllEnvironment();
73 } 73 }
74 74
75 TEST_F(LocaleTestsZhTw, TestStart) { 75 TEST_F(LocaleTestsZhTw, TestStart) {
76 // Just making sure we can start/shutdown cleanly. 76 // Just making sure we can start/shutdown cleanly.
77 RestoreLcAllEnvironment(); 77 RestoreLcAllEnvironment();
78 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698