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

Side by Side Diff: chrome/browser/chromeos/login/test/oobe_base_test.cc

Issue 2033753002: Remove use of deprecated MessageLoop methods in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/oobe_base_test.h" 5 #include "chrome/browser/chromeos/login/test/oobe_base_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/location.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "base/single_thread_task_runner.h"
12 #include "base/threading/thread_task_runner_handle.h"
11 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/chromeos/login/existing_user_controller.h" 14 #include "chrome/browser/chromeos/login/existing_user_controller.h"
13 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 15 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
14 #include "chrome/browser/chromeos/login/session/user_session_manager_test_api.h" 16 #include "chrome/browser/chromeos/login/session/user_session_manager_test_api.h"
15 #include "chrome/browser/chromeos/login/test/https_forwarder.h" 17 #include "chrome/browser/chromeos/login/test/https_forwarder.h"
16 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 18 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
17 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" 19 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
18 #include "chrome/browser/lifetime/application_lifetime.h" 20 #include "chrome/browser/lifetime/application_lifetime.h"
19 #include "chrome/browser/ui/webui/signin/get_auth_frame.h" 21 #include "chrome/browser/ui/webui/signin/get_auth_frame.h"
20 #include "chrome/common/chrome_paths.h" 22 #include "chrome/common/chrome_paths.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 run_loop.QuitClosure())) { 120 run_loop.QuitClosure())) {
119 run_loop.Run(); 121 run_loop.Run();
120 } 122 }
121 123
122 ExtensionApiTest::SetUpOnMainThread(); 124 ExtensionApiTest::SetUpOnMainThread();
123 } 125 }
124 126
125 void OobeBaseTest::TearDownOnMainThread() { 127 void OobeBaseTest::TearDownOnMainThread() {
126 // If the login display is still showing, exit gracefully. 128 // If the login display is still showing, exit gracefully.
127 if (LoginDisplayHost::default_host()) { 129 if (LoginDisplayHost::default_host()) {
128 base::MessageLoop::current()->PostTask(FROM_HERE, 130 base::ThreadTaskRunnerHandle::Get()->PostTask(
129 base::Bind(&chrome::AttemptExit)); 131 FROM_HERE, base::Bind(&chrome::AttemptExit));
130 content::RunMessageLoop(); 132 content::RunMessageLoop();
131 } 133 }
132 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); 134 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
133 135
134 ExtensionApiTest::TearDownOnMainThread(); 136 ExtensionApiTest::TearDownOnMainThread();
135 } 137 }
136 138
137 void OobeBaseTest::SetUpCommandLine(base::CommandLine* command_line) { 139 void OobeBaseTest::SetUpCommandLine(base::CommandLine* command_line) {
138 ExtensionApiTest::SetUpCommandLine(command_line); 140 ExtensionApiTest::SetUpCommandLine(command_line);
139 141
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 "document.getElementById('$FieldId').value = '$FieldValue';" 267 "document.getElementById('$FieldId').value = '$FieldValue';"
266 "var e = new Event('input');" 268 "var e = new Event('input');"
267 "document.getElementById('$FieldId').dispatchEvent(e);" 269 "document.getElementById('$FieldId').dispatchEvent(e);"
268 "})();"; 270 "})();";
269 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); 271 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id);
270 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); 272 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value);
271 ExecuteJsInSigninFrame(js); 273 ExecuteJsInSigninFrame(js);
272 } 274 }
273 275
274 } // namespace chromeos 276 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698