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

Side by Side Diff: chrome/browser/chromeos/login/proxy_auth_dialog_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/chromeos/login/login_manager_test.h" 10 #include "chrome/browser/chromeos/login/login_manager_test.h"
11 #include "chrome/browser/chromeos/login/startup_utils.h" 11 #include "chrome/browser/chromeos/login/startup_utils.h"
12 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" 12 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h"
13 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 13 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 14 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
16 #include "chrome/browser/ui/login/login_prompt.h" 15 #include "chrome/browser/ui/login/login_prompt.h"
17 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 16 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
18 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
20 #include "content/public/browser/notification_details.h" 19 #include "content/public/browser/notification_details.h"
21 #include "content/public/browser/web_ui.h" 20 #include "content/public/browser/web_ui.h"
22 #include "content/public/browser/web_ui_controller.h" 21 #include "content/public/browser/web_ui_controller.h"
23 #include "content/public/test/browser_test_utils.h" 22 #include "content/public/test/browser_test_utils.h"
24 #include "content/public/test/test_utils.h" 23 #include "content/public/test/test_utils.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 94
96 // Times out under MSan, and is flaky for ASan: https://crbug.com/481651 95 // Times out under MSan, and is flaky for ASan: https://crbug.com/481651
97 #if defined(MEMORY_SANITIZER) || defined(ADDRESS_SANITIZER) 96 #if defined(MEMORY_SANITIZER) || defined(ADDRESS_SANITIZER)
98 #define MAYBE_ProxyAuthDialogOnUserBoardScreen \ 97 #define MAYBE_ProxyAuthDialogOnUserBoardScreen \
99 DISABLED_ProxyAuthDialogOnUserBoardScreen 98 DISABLED_ProxyAuthDialogOnUserBoardScreen
100 #else 99 #else
101 #define MAYBE_ProxyAuthDialogOnUserBoardScreen ProxyAuthDialogOnUserBoardScreen 100 #define MAYBE_ProxyAuthDialogOnUserBoardScreen ProxyAuthDialogOnUserBoardScreen
102 #endif 101 #endif
103 IN_PROC_BROWSER_TEST_F(ProxyAuthOnUserBoardScreenTest, 102 IN_PROC_BROWSER_TEST_F(ProxyAuthOnUserBoardScreenTest,
104 MAYBE_ProxyAuthDialogOnUserBoardScreen) { 103 MAYBE_ProxyAuthDialogOnUserBoardScreen) {
105 LoginDisplayHost* login_display_host = LoginDisplayHostImpl::default_host(); 104 LoginDisplayHost* login_display_host = LoginDisplayHost::default_host();
106 WebUILoginView* web_ui_login_view = login_display_host->GetWebUILoginView(); 105 WebUILoginView* web_ui_login_view = login_display_host->GetWebUILoginView();
107 OobeUI* oobe_ui = 106 OobeUI* oobe_ui =
108 static_cast<OobeUI*>(web_ui_login_view->GetWebUI()->GetController()); 107 static_cast<OobeUI*>(web_ui_login_view->GetWebUI()->GetController());
109 108
110 { 109 {
111 OobeScreenWaiter screen_waiter(OobeDisplay::SCREEN_ACCOUNT_PICKER); 110 OobeScreenWaiter screen_waiter(OobeDisplay::SCREEN_ACCOUNT_PICKER);
112 ProxyAuthDialogWaiter auth_dialog_waiter; 111 ProxyAuthDialogWaiter auth_dialog_waiter;
113 screen_waiter.Wait(); 112 screen_waiter.Wait();
114 auth_dialog_waiter.Wait(); 113 auth_dialog_waiter.Wait();
115 114
116 ASSERT_TRUE(auth_dialog_waiter.login_handler()); 115 ASSERT_TRUE(auth_dialog_waiter.login_handler());
117 auth_dialog_waiter.login_handler()->CancelAuth(); 116 auth_dialog_waiter.login_handler()->CancelAuth();
118 } 117 }
119 118
120 { 119 {
121 OobeScreenWaiter screen_waiter(OobeDisplay::SCREEN_GAIA_SIGNIN); 120 OobeScreenWaiter screen_waiter(OobeDisplay::SCREEN_GAIA_SIGNIN);
122 ProxyAuthDialogWaiter auth_dialog_waiter; 121 ProxyAuthDialogWaiter auth_dialog_waiter;
123 ASSERT_TRUE(content::ExecuteScript(oobe_ui->web_ui()->GetWebContents(), 122 ASSERT_TRUE(content::ExecuteScript(oobe_ui->web_ui()->GetWebContents(),
124 "window.domAutomationController.send(!!(" 123 "window.domAutomationController.send(!!("
125 "$('add-user-button').click()" 124 "$('add-user-button').click()"
126 "));")); 125 "));"));
127 screen_waiter.Wait(); 126 screen_waiter.Wait();
128 auth_dialog_waiter.Wait(); 127 auth_dialog_waiter.Wait();
129 ASSERT_TRUE(auth_dialog_waiter.login_handler()); 128 ASSERT_TRUE(auth_dialog_waiter.login_handler());
130 } 129 }
131 } 130 }
132 131
133 } // namespace chromeos 132 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/oobe_localization_browsertest.cc ('k') | chrome/browser/chromeos/login/screens/error_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698