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

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

Issue 1610823003: Migrate call sites LoginDisplayHostImpl::default_host to LoginDisplayHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-add-supervised-user
Patch Set: Address comments Created 4 years, 11 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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/login/login_manager_test.h" 12 #include "chrome/browser/chromeos/login/login_manager_test.h"
13 #include "chrome/browser/chromeos/login/startup_utils.h" 13 #include "chrome/browser/chromeos/login/startup_utils.h"
14 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" 14 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h"
15 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 15 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
16 #include "chrome/browser/chromeos/login/ui/oobe_display.h" 16 #include "chrome/browser/chromeos/login/ui/oobe_display.h"
17 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 17 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
18 #include "chrome/common/chrome_constants.h" 18 #include "chrome/common/chrome_constants.h"
19 #include "chrome/common/chrome_paths.h" 19 #include "chrome/common/chrome_paths.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
22 #include "chromeos/chromeos_switches.h" 22 #include "chromeos/chromeos_switches.h"
23 #include "chromeos/dbus/dbus_thread_manager.h" 23 #include "chromeos/dbus/dbus_thread_manager.h"
24 #include "chromeos/dbus/fake_debug_daemon_client.h" 24 #include "chromeos/dbus/fake_debug_daemon_client.h"
25 #include "chromeos/dbus/fake_power_manager_client.h" 25 #include "chromeos/dbus/fake_power_manager_client.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 scoped_ptr<DebugDaemonClient>(debug_daemon_client_)); 186 scoped_ptr<DebugDaemonClient>(debug_daemon_client_));
187 187
188 LoginManagerTest::SetUpInProcessBrowserTestFixture(); 188 LoginManagerTest::SetUpInProcessBrowserTestFixture();
189 } 189 }
190 190
191 bool JSExecuted(const std::string& script) { 191 bool JSExecuted(const std::string& script) {
192 return content::ExecuteScript(web_contents(), script); 192 return content::ExecuteScript(web_contents(), script);
193 } 193 }
194 194
195 void WaitUntilJSIsReady() { 195 void WaitUntilJSIsReady() {
196 LoginDisplayHostImpl* host = static_cast<LoginDisplayHostImpl*>( 196 LoginDisplayHost* host = LoginDisplayHost::default_host();
197 LoginDisplayHostImpl::default_host());
198 if (!host) 197 if (!host)
199 return; 198 return;
200 chromeos::OobeUI* oobe_ui = host->GetOobeUI(); 199 chromeos::OobeUI* oobe_ui = host->GetOobeUI();
201 if (!oobe_ui) 200 if (!oobe_ui)
202 return; 201 return;
203 base::RunLoop run_loop; 202 base::RunLoop run_loop;
204 const bool oobe_ui_ready = oobe_ui->IsJSReady(run_loop.QuitClosure()); 203 const bool oobe_ui_ready = oobe_ui->IsJSReady(run_loop.QuitClosure());
205 if (!oobe_ui_ready) 204 if (!oobe_ui_ready)
206 run_loop.Run(); 205 run_loop.Run();
207 } 206 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 408 }
410 409
411 // Canceling auto shown setup screen should close it. 410 // Canceling auto shown setup screen should close it.
412 IN_PROC_BROWSER_TEST_F(EnableDebuggingRequestedTest, CancelAutoShowSetup) { 411 IN_PROC_BROWSER_TEST_F(EnableDebuggingRequestedTest, CancelAutoShowSetup) {
413 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENABLE_DEBUGGING).Wait(); 412 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENABLE_DEBUGGING).Wait();
414 CloseEnableDebuggingScreen(); 413 CloseEnableDebuggingScreen();
415 JSExpect("!!document.querySelector('#debugging.hidden')"); 414 JSExpect("!!document.querySelector('#debugging.hidden')");
416 } 415 }
417 416
418 } // namespace chromeos 417 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698