| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" | 
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" | 
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" | 
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" | 
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" | 
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 102   self->done = true; | 102   self->done = true; | 
| 103 } | 103 } | 
| 104 | 104 | 
| 105 void RunSwitchLanguageTest(const std::string& locale, | 105 void RunSwitchLanguageTest(const std::string& locale, | 
| 106                                   const std::string& expected_locale, | 106                                   const std::string& expected_locale, | 
| 107                                   const bool expect_success) { | 107                                   const bool expect_success) { | 
| 108   SwitchLanguageTestData data; | 108   SwitchLanguageTestData data; | 
| 109   scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 109   scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 
| 110       new locale_util::SwitchLanguageCallback( | 110       new locale_util::SwitchLanguageCallback( | 
| 111           base::Bind(&OnLocaleSwitched, base::Unretained(&data)))); | 111           base::Bind(&OnLocaleSwitched, base::Unretained(&data)))); | 
| 112   locale_util::SwitchLanguage(locale, true, callback.Pass()); | 112   locale_util::SwitchLanguage(locale, true, false, callback.Pass()); | 
| 113 | 113 | 
| 114   // Token writing moves control to BlockingPool and back. | 114   // Token writing moves control to BlockingPool and back. | 
| 115   base::RunLoop().RunUntilIdle(); | 115   base::RunLoop().RunUntilIdle(); | 
| 116   content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 116   content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 
| 117   base::RunLoop().RunUntilIdle(); | 117   base::RunLoop().RunUntilIdle(); | 
| 118 | 118 | 
| 119   EXPECT_EQ(data.done, true); | 119   EXPECT_EQ(data.done, true); | 
| 120   EXPECT_EQ(data.requested_locale, locale); | 120   EXPECT_EQ(data.requested_locale, locale); | 
| 121   EXPECT_EQ(data.loaded_locale, expected_locale); | 121   EXPECT_EQ(data.loaded_locale, expected_locale); | 
| 122   EXPECT_EQ(data.success, expect_success); | 122   EXPECT_EQ(data.success, expect_success); | 
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 759 } | 759 } | 
| 760 | 760 | 
| 761 // TODO(dzhioev): Add test emaulating device with wrong HWID. | 761 // TODO(dzhioev): Add test emaulating device with wrong HWID. | 
| 762 | 762 | 
| 763 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 | 763 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 | 
| 764 | 764 | 
| 765 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 19, | 765 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 19, | 
| 766                add_tests_for_new_control_flow_you_just_introduced); | 766                add_tests_for_new_control_flow_you_just_introduced); | 
| 767 | 767 | 
| 768 }  // namespace chromeos | 768 }  // namespace chromeos | 
| OLD | NEW | 
|---|