chromeos: bluetooth: tie Proxy lifetime to object, not observer
[chromium-blink-merge.git] / chrome / browser / locale_tests_uitest.cc
blobea171a8d503e64d8872498269a708eb7e821815f
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 {
11 public:
12 LocaleTestsBase() : UITest(), old_lc_all_(NULL) {
15 virtual void TearDown() {
16 #if defined(OS_LINUX)
17 scoped_ptr<base::Environment> env(base::Environment::Create());
18 if (old_lc_all_) {
19 env->SetVar("LC_ALL", old_lc_all_);
20 } else {
21 env->UnSetVar("LC_ALL");
23 #endif
24 UITest::TearDown();
27 protected:
28 const char* old_lc_all_;
32 class LocaleTestsDa : public LocaleTestsBase {
33 public:
34 LocaleTestsDa() : LocaleTestsBase() {
35 launch_arguments_.AppendSwitchASCII("lang", "da");
37 // Linux doesn't use --lang, it only uses environment variables to set the
38 // language.
39 #if defined(OS_LINUX)
40 old_lc_all_ = getenv("LC_ALL");
41 setenv("LC_ALL", "da_DK.UTF-8", 1);
42 #endif
46 class LocaleTestsHe : public LocaleTestsBase {
47 public:
48 LocaleTestsHe() : LocaleTestsBase() {
49 launch_arguments_.AppendSwitchASCII("lang", "he");
50 #if defined(OS_LINUX)
51 old_lc_all_ = getenv("LC_ALL");
52 setenv("LC_ALL", "he_IL.UTF-8", 1);
53 #endif
57 class LocaleTestsZhTw : public LocaleTestsBase {
58 public:
59 LocaleTestsZhTw() : LocaleTestsBase() {
60 launch_arguments_.AppendSwitchASCII("lang", "zh-TW");
61 #if defined(OS_LINUX)
62 old_lc_all_ = getenv("LC_ALL");
63 setenv("LC_ALL", "zh_TW.UTF-8", 1);
64 #endif
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.