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

Side by Side Diff: chrome/browser/chromeos/shutdown_policy_browsertest.cc

Issue 2859363003: cros: Initial structure for views-based lock. (Closed)
Patch Set: Address comments Created 3 years, 7 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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 7
8 #include "ash/login_status.h" 8 #include "ash/login_status.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/strings/grit/ash_strings.h" 10 #include "ash/strings/grit/ash_strings.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Bring up the locker screen. 231 // Bring up the locker screen.
232 ScreenLocker::Show(); 232 ScreenLocker::Show();
233 std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester()); 233 std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester());
234 tester->EmulateWindowManagerReady(); 234 tester->EmulateWindowManagerReady();
235 content::WindowedNotificationObserver lock_state_observer( 235 content::WindowedNotificationObserver lock_state_observer(
236 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, 236 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
237 content::NotificationService::AllSources()); 237 content::NotificationService::AllSources());
238 if (!tester->IsLocked()) 238 if (!tester->IsLocked())
239 lock_state_observer.Wait(); 239 lock_state_observer.Wait();
240 ScreenLocker* screen_locker = ScreenLocker::default_screen_locker(); 240 ScreenLocker* screen_locker = ScreenLocker::default_screen_locker();
241 WebUIScreenLocker* web_ui_screen_locker = screen_locker->web_ui(); 241 WebUIScreenLocker* web_ui_screen_locker =
242 screen_locker->web_ui_for_testing();
242 ASSERT_TRUE(web_ui_screen_locker); 243 ASSERT_TRUE(web_ui_screen_locker);
243 content::WebUI* web_ui = web_ui_screen_locker->GetWebUI(); 244 content::WebUI* web_ui = web_ui_screen_locker->GetWebUI();
244 ASSERT_TRUE(web_ui); 245 ASSERT_TRUE(web_ui);
245 contents_ = web_ui->GetWebContents(); 246 contents_ = web_ui->GetWebContents();
246 ASSERT_TRUE(contents_); 247 ASSERT_TRUE(contents_);
247 248
248 // Wait for the login UI to be ready. 249 // Wait for the login UI to be ready.
249 WaitUntilOobeUIIsReady(web_ui_screen_locker->GetOobeUI()); 250 WaitUntilOobeUIIsReady(web_ui_screen_locker->GetOobeUI());
250 } 251 }
251 252
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 PrepareAndRunScript("restart-header-bar-item", false); 334 PrepareAndRunScript("restart-header-bar-item", false);
334 PrepareAndRunScript("shutdown-header-bar-item", true); 335 PrepareAndRunScript("shutdown-header-bar-item", true);
335 336
336 UpdateRebootOnShutdownPolicy(false); 337 UpdateRebootOnShutdownPolicy(false);
337 RefreshDevicePolicy(); 338 RefreshDevicePolicy();
338 PrepareAndRunScript("restart-header-bar-item", true); 339 PrepareAndRunScript("restart-header-bar-item", true);
339 PrepareAndRunScript("shutdown-header-bar-item", false); 340 PrepareAndRunScript("shutdown-header-bar-item", false);
340 } 341 }
341 342
342 } // namespace chromeos 343 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698