Commit 56861a66 authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Remove some unused ScreenLockerTester methods

TBR=dtseng@chromium.org

Bug: 899777
Change-Id: I2301630944dbd19198a9d09d4030dde2ddacb587
Reviewed-on: https://chromium-review.googlesource.com/c/1303051
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605482}
parent 93ee1837
...@@ -242,7 +242,6 @@ IN_PROC_BROWSER_TEST_F(UsersPrivateApiLockStatusTest, ScreenLock) { ...@@ -242,7 +242,6 @@ IN_PROC_BROWSER_TEST_F(UsersPrivateApiLockStatusTest, ScreenLock) {
chromeos::ScreenLocker::Show(); chromeos::ScreenLocker::Show();
std::unique_ptr<chromeos::test::ScreenLockerTester> tester( std::unique_ptr<chromeos::test::ScreenLockerTester> tester(
chromeos::ScreenLocker::GetTester()); chromeos::ScreenLocker::GetTester());
tester->EmulateWindowManagerReady();
content::WindowedNotificationObserver lock_state_observer( content::WindowedNotificationObserver lock_state_observer(
chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
......
...@@ -102,7 +102,6 @@ class ScreenLockerTest : public InProcessBrowserTest { ...@@ -102,7 +102,6 @@ class ScreenLockerTest : public InProcessBrowserTest {
void LockScreen(test::ScreenLockerTester* tester) { void LockScreen(test::ScreenLockerTester* tester) {
ScreenLocker::Show(); ScreenLocker::Show();
tester->EmulateWindowManagerReady();
content::WindowedNotificationObserver lock_state_observer( content::WindowedNotificationObserver lock_state_observer(
chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
...@@ -158,7 +157,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, TestBasic) { ...@@ -158,7 +157,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, TestBasic) {
return; return;
ScreenLocker::Show(); ScreenLocker::Show();
std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester()); std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester());
tester->EmulateWindowManagerReady();
content::WindowedNotificationObserver lock_state_observer( content::WindowedNotificationObserver lock_state_observer(
chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
...@@ -167,13 +165,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, TestBasic) { ...@@ -167,13 +165,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, TestBasic) {
EXPECT_EQ(session_manager::SessionState::LOCKED, EXPECT_EQ(session_manager::SessionState::LOCKED,
session_manager::SessionManager::Get()->session_state()); session_manager::SessionManager::Get()->session_state());
// Test to make sure that the widget is actually appearing and is of
// reasonable size, preventing a regression of
// http://code.google.com/p/chromium-os/issues/detail?id=5987
gfx::Rect lock_bounds = tester->GetChildWidget()->GetWindowBoundsInScreen();
EXPECT_GT(lock_bounds.width(), 10);
EXPECT_GT(lock_bounds.height(), 10);
UserContext user_context(user_manager::UserType::USER_TYPE_REGULAR, UserContext user_context(user_manager::UserType::USER_TYPE_REGULAR,
user_manager::StubAccountId()); user_manager::StubAccountId());
user_context.SetKey(Key("pass")); user_context.SetKey(Key("pass"));
...@@ -238,7 +229,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, MAYBE_TestFullscreenExit) { ...@@ -238,7 +229,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, MAYBE_TestFullscreenExit) {
{ {
Waiter waiter(browser()); Waiter waiter(browser());
ScreenLocker::Show(); ScreenLocker::Show();
tester->EmulateWindowManagerReady();
waiter.Wait(true /* locked */, true /* full screen */); waiter.Wait(true /* locked */, true /* full screen */);
EXPECT_TRUE(browser_window->IsFullscreen()); EXPECT_TRUE(browser_window->IsFullscreen());
EXPECT_FALSE(window_state->GetHideShelfWhenFullscreen()); EXPECT_FALSE(window_state->GetHideShelfWhenFullscreen());
...@@ -284,7 +274,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, MAYBE_TestFullscreenExit) { ...@@ -284,7 +274,6 @@ IN_PROC_BROWSER_TEST_F(WebUiScreenLockerTest, MAYBE_TestFullscreenExit) {
{ {
Waiter waiter(browser()); Waiter waiter(browser());
ScreenLocker::Show(); ScreenLocker::Show();
tester->EmulateWindowManagerReady();
waiter.Wait(true /* locked */, false /* full screen */); waiter.Wait(true /* locked */, false /* full screen */);
EXPECT_FALSE(browser_window->IsFullscreen()); EXPECT_FALSE(browser_window->IsFullscreen());
EXPECT_TRUE(tester->IsLocked()); EXPECT_TRUE(tester->IsLocked());
...@@ -327,27 +316,4 @@ IN_PROC_BROWSER_TEST_F(ScreenLockerTest, TestShowTwice) { ...@@ -327,27 +316,4 @@ IN_PROC_BROWSER_TEST_F(ScreenLockerTest, TestShowTwice) {
EXPECT_TRUE(VerifyLockScreenDismissed()); EXPECT_TRUE(VerifyLockScreenDismissed());
} }
// TODO(flackr): Find out why the RenderView isn't getting the escape press
// and re-enable this test (currently this test is flaky).
IN_PROC_BROWSER_TEST_F(ScreenLockerTest, DISABLED_TestEscape) {
std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester());
LockScreen(tester.get());
EXPECT_EQ(
1, fake_session_manager_client_->notify_lock_screen_shown_call_count());
tester->SetPassword("password");
EXPECT_EQ("password", tester->GetPassword());
// Escape clears the password.
SimulateKeyPress(tester->GetWidget(), ui::VKEY_ESCAPE);
content::RunAllPendingInMessageLoop();
EXPECT_EQ("", tester->GetPassword());
// Close the locker to match expectations.
ScreenLocker::Hide();
content::RunAllPendingInMessageLoop();
EXPECT_FALSE(tester->IsLocked());
EXPECT_TRUE(VerifyLockScreenDismissed());
}
} // namespace chromeos } // namespace chromeos
...@@ -98,9 +98,6 @@ class WebUIScreenLockerTester : public ScreenLockerTester { ...@@ -98,9 +98,6 @@ class WebUIScreenLockerTester : public ScreenLockerTester {
void SetPassword(const std::string& password) override; void SetPassword(const std::string& password) override;
std::string GetPassword() override; std::string GetPassword() override;
void EnterPassword(const std::string& password) override; void EnterPassword(const std::string& password) override;
void EmulateWindowManagerReady() override;
views::Widget* GetWidget() const override;
views::Widget* GetChildWidget() const override;
private: private:
friend class chromeos::ScreenLocker; friend class chromeos::ScreenLocker;
...@@ -159,16 +156,6 @@ void WebUIScreenLockerTester::EnterPassword(const std::string& password) { ...@@ -159,16 +156,6 @@ void WebUIScreenLockerTester::EnterPassword(const std::string& password) {
login.WaitForAttempt(); login.WaitForAttempt();
} }
void WebUIScreenLockerTester::EmulateWindowManagerReady() {}
views::Widget* WebUIScreenLockerTester::GetWidget() const {
return webui_screen_locker()->lock_window_;
}
views::Widget* WebUIScreenLockerTester::GetChildWidget() const {
return webui_screen_locker()->lock_window_;
}
content::RenderFrameHost* WebUIScreenLockerTester::GetMainFrame() const { content::RenderFrameHost* WebUIScreenLockerTester::GetMainFrame() const {
return webui()->GetWebContents()->GetMainFrame(); return webui()->GetWebContents()->GetMainFrame();
} }
......
...@@ -7,10 +7,6 @@ ...@@ -7,10 +7,6 @@
#include <string> #include <string>
namespace views {
class Widget;
} // namespace views
namespace chromeos { namespace chromeos {
class UserContext; class UserContext;
...@@ -38,14 +34,6 @@ class ScreenLockerTester { ...@@ -38,14 +34,6 @@ class ScreenLockerTester {
// Emulates entring a password. // Emulates entring a password.
virtual void EnterPassword(const std::string& password) = 0; virtual void EnterPassword(const std::string& password) = 0;
// Emulates the ready message from window manager.
virtual void EmulateWindowManagerReady() = 0;
// Returns the widget for screen locker window.
virtual views::Widget* GetWidget() const = 0;
virtual views::Widget* GetChildWidget() const = 0;
}; };
} // namespace test } // namespace test
......
...@@ -239,7 +239,6 @@ class ShutdownPolicyLockerTest : public ShutdownPolicyBaseTest { ...@@ -239,7 +239,6 @@ class ShutdownPolicyLockerTest : public ShutdownPolicyBaseTest {
// Bring up the locker screen. // Bring up the locker screen.
ScreenLocker::Show(); ScreenLocker::Show();
std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester()); std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester());
tester->EmulateWindowManagerReady();
content::WindowedNotificationObserver lock_state_observer( content::WindowedNotificationObserver lock_state_observer(
chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
......
...@@ -306,7 +306,6 @@ class BrailleDisplayPrivateAPIUserTest : public BrailleDisplayPrivateApiTest { ...@@ -306,7 +306,6 @@ class BrailleDisplayPrivateAPIUserTest : public BrailleDisplayPrivateApiTest {
void LockScreen(ScreenLockerTester* tester) { void LockScreen(ScreenLockerTester* tester) {
ScreenLocker::Show(); ScreenLocker::Show();
tester->EmulateWindowManagerReady();
content::WindowedNotificationObserver lock_state_observer( content::WindowedNotificationObserver lock_state_observer(
chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment