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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller_browsertest.cc

Issue 409743003: Use content::RunBlockingPoolTask() in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased + reverted changes to content/browser/media/webrtc_identity_store_unittest.cc. Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chromeos/login/wizard_controller.h"
6
5 #include "base/basictypes.h" 7 #include "base/basictypes.h"
6 #include "base/command_line.h" 8 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
8 #include "base/path_service.h" 10 #include "base/path_service.h"
9 #include "base/prefs/pref_registry_simple.h" 11 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
11 #include "base/prefs/pref_service_factory.h" 13 #include "base/prefs/pref_service_factory.h"
12 #include "base/prefs/testing_pref_store.h" 14 #include "base/prefs/testing_pref_store.h"
13 #include "base/run_loop.h" 15 #include "base/run_loop.h"
14 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
(...skipping 15 matching lines...) Expand all
30 #include "chrome/browser/chromeos/login/screens/mock_update_screen.h" 32 #include "chrome/browser/chromeos/login/screens/mock_update_screen.h"
31 #include "chrome/browser/chromeos/login/screens/network_screen.h" 33 #include "chrome/browser/chromeos/login/screens/network_screen.h"
32 #include "chrome/browser/chromeos/login/screens/reset_screen.h" 34 #include "chrome/browser/chromeos/login/screens/reset_screen.h"
33 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" 35 #include "chrome/browser/chromeos/login/screens/user_image_screen.h"
34 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" 36 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h"
35 #include "chrome/browser/chromeos/login/startup_utils.h" 37 #include "chrome/browser/chromeos/login/startup_utils.h"
36 #include "chrome/browser/chromeos/login/test/wizard_in_process_browser_test.h" 38 #include "chrome/browser/chromeos/login/test/wizard_in_process_browser_test.h"
37 #include "chrome/browser/chromeos/login/test_login_utils.h" 39 #include "chrome/browser/chromeos/login/test_login_utils.h"
38 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 40 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
39 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 41 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
40 #include "chrome/browser/chromeos/login/wizard_controller.h"
41 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" 42 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
42 #include "chrome/browser/chromeos/policy/server_backed_device_state.h" 43 #include "chrome/browser/chromeos/policy/server_backed_device_state.h"
43 #include "chrome/browser/chromeos/profiles/profile_helper.h" 44 #include "chrome/browser/chromeos/profiles/profile_helper.h"
44 #include "chrome/browser/chromeos/timezone/timezone_request.h" 45 #include "chrome/browser/chromeos/timezone/timezone_request.h"
45 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 46 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
46 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" 47 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
47 #include "chrome/common/chrome_paths.h" 48 #include "chrome/common/chrome_paths.h"
48 #include "chrome/common/chrome_switches.h" 49 #include "chrome/common/chrome_switches.h"
49 #include "chrome/common/pref_names.h" 50 #include "chrome/common/pref_names.h"
50 #include "chrome/grit/generated_resources.h" 51 #include "chrome/grit/generated_resources.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void RunSwitchLanguageTest(const std::string& locale, 141 void RunSwitchLanguageTest(const std::string& locale,
141 const std::string& expected_locale, 142 const std::string& expected_locale,
142 const bool expect_success) { 143 const bool expect_success) {
143 SwitchLanguageTestData data; 144 SwitchLanguageTestData data;
144 scoped_ptr<locale_util::SwitchLanguageCallback> callback( 145 scoped_ptr<locale_util::SwitchLanguageCallback> callback(
145 new locale_util::SwitchLanguageCallback( 146 new locale_util::SwitchLanguageCallback(
146 base::Bind(&OnLocaleSwitched, base::Unretained(&data)))); 147 base::Bind(&OnLocaleSwitched, base::Unretained(&data))));
147 locale_util::SwitchLanguage(locale, true, false, callback.Pass()); 148 locale_util::SwitchLanguage(locale, true, false, callback.Pass());
148 149
149 // Token writing moves control to BlockingPool and back. 150 // Token writing moves control to BlockingPool and back.
150 base::RunLoop().RunUntilIdle(); 151 content::RunAllBlockingPoolTasksUntilIdle();
151 content::BrowserThread::GetBlockingPool()->FlushForTesting();
152 base::RunLoop().RunUntilIdle();
153 152
154 EXPECT_EQ(data.done, true); 153 EXPECT_EQ(data.done, true);
155 EXPECT_EQ(data.requested_locale, locale); 154 EXPECT_EQ(data.requested_locale, locale);
156 EXPECT_EQ(data.loaded_locale, expected_locale); 155 EXPECT_EQ(data.loaded_locale, expected_locale);
157 EXPECT_EQ(data.success, expect_success); 156 EXPECT_EQ(data.success, expect_success);
158 } 157 }
159 158
160 void SetUpCrasAndEnableChromeVox(int volume_percent, bool mute_on) { 159 void SetUpCrasAndEnableChromeVox(int volume_percent, bool mute_on) {
161 AccessibilityManager* a11y = AccessibilityManager::Get(); 160 AccessibilityManager* a11y = AccessibilityManager::Get();
162 CrasAudioHandler* cras = CrasAudioHandler::Get(); 161 CrasAudioHandler* cras = CrasAudioHandler::Get();
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when 1094 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when
1096 // UI and logic is ready. http://crbug.com/127016 1095 // UI and logic is ready. http://crbug.com/127016
1097 1096
1098 // TODO(dzhioev): Add tests for controller/host pairing flow. 1097 // TODO(dzhioev): Add tests for controller/host pairing flow.
1099 // http://crbug.com/375191 1098 // http://crbug.com/375191
1100 1099
1101 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 23, 1100 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 23,
1102 add_tests_for_new_control_flow_you_just_introduced); 1101 add_tests_for_new_control_flow_you_just_introduced);
1103 1102
1104 } // namespace chromeos 1103 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698