| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 "base/environment.h" | 7 #include "base/environment.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 class LocaleTestsBase : public UITest { | 10 class LocaleTestsBase : public UITest { |
| 11 public: | 11 public: |
| 12 LocaleTestsBase() : UITest(), old_lc_all_(NULL) { | 12 LocaleTestsBase() : UITest(), old_lc_all_(NULL) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 protected: | 15 protected: |
| 16 void RestoreLcAllEnvironment() { | 16 void RestoreLcAllEnvironment() { |
| 17 #if defined(OS_LINUX) | 17 #if defined(OS_LINUX) |
| 18 scoped_ptr<base::Environment> env(base::Environment::Create()); | 18 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 19 if (old_lc_all_) { | 19 if (old_lc_all_) { |
| 20 env->SetEnv("LC_ALL", old_lc_all_); | 20 env->SetVar("LC_ALL", old_lc_all_); |
| 21 } else { | 21 } else { |
| 22 env->UnSetVar("LC_ALL"); | 22 env->UnSetVar("LC_ALL"); |
| 23 } | 23 } |
| 24 #endif | 24 #endif |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 const char* old_lc_all_; | 27 const char* old_lc_all_; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 | 30 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 TEST_F(LocaleTestsHe, TestStart) { | 72 TEST_F(LocaleTestsHe, TestStart) { |
| 73 // Just making sure we can start/shutdown cleanly. | 73 // Just making sure we can start/shutdown cleanly. |
| 74 RestoreLcAllEnvironment(); | 74 RestoreLcAllEnvironment(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 TEST_F(LocaleTestsZhTw, TestStart) { | 77 TEST_F(LocaleTestsZhTw, TestStart) { |
| 78 // Just making sure we can start/shutdown cleanly. | 78 // Just making sure we can start/shutdown cleanly. |
| 79 RestoreLcAllEnvironment(); | 79 RestoreLcAllEnvironment(); |
| 80 } | 80 } |
| OLD | NEW |