1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/test/ui/ui_test.h"
7 #include "base/environment.h"
8 #include "build/build_config.h"
10 class LocaleTestsBase
: public UITest
{
12 LocaleTestsBase() : UITest(), old_lc_all_(NULL
) {
15 virtual void TearDown() {
17 scoped_ptr
<base::Environment
> env(base::Environment::Create());
19 env
->SetVar("LC_ALL", old_lc_all_
);
21 env
->UnSetVar("LC_ALL");
28 const char* old_lc_all_
;
32 class LocaleTestsDa
: public LocaleTestsBase
{
34 LocaleTestsDa() : LocaleTestsBase() {
35 launch_arguments_
.AppendSwitchASCII("lang", "da");
37 // Linux doesn't use --lang, it only uses environment variables to set the
40 old_lc_all_
= getenv("LC_ALL");
41 setenv("LC_ALL", "da_DK.UTF-8", 1);
46 class LocaleTestsHe
: public LocaleTestsBase
{
48 LocaleTestsHe() : LocaleTestsBase() {
49 launch_arguments_
.AppendSwitchASCII("lang", "he");
51 old_lc_all_
= getenv("LC_ALL");
52 setenv("LC_ALL", "he_IL.UTF-8", 1);
57 class LocaleTestsZhTw
: public LocaleTestsBase
{
59 LocaleTestsZhTw() : LocaleTestsBase() {
60 launch_arguments_
.AppendSwitchASCII("lang", "zh-TW");
62 old_lc_all_
= getenv("LC_ALL");
63 setenv("LC_ALL", "zh_TW.UTF-8", 1);
68 TEST_F(LocaleTestsDa
, TestStart
) {
69 // Just making sure we can start/shutdown cleanly.
72 TEST_F(LocaleTestsHe
, TestStart
) {
73 // Just making sure we can start/shutdown cleanly.
76 TEST_F(LocaleTestsZhTw
, TestStart
) {
77 // Just making sure we can start/shutdown cleanly.