Home | History | Annotate | Download | only in lock
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_
      6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_
      7 
      8 #include <string>
      9 
     10 #include "base/basictypes.h"
     11 
     12 namespace views {
     13 class Widget;
     14 }  // namespace views
     15 
     16 namespace chromeos {
     17 
     18 class UserContext;
     19 
     20 namespace test {
     21 
     22 // ScreenLockerTester provides access to the private state/function
     23 // of ScreenLocker class. Used to implement unit tests.
     24 class ScreenLockerTester {
     25  public:
     26   ScreenLockerTester();
     27   virtual ~ScreenLockerTester();
     28 
     29   // Returns true if the screen is locked.
     30   virtual bool IsLocked();
     31 
     32   // Injects MockAuthenticator that uses the credentials in |user_context|.
     33   virtual void InjectMockAuthenticator(const UserContext& user_context);
     34 
     35   // Sets the password text.
     36   virtual void SetPassword(const std::string& password) = 0;
     37 
     38   // Gets the password text.
     39   virtual std::string GetPassword() = 0;
     40 
     41   // Emulates entring a password.
     42   virtual void EnterPassword(const std::string& password) = 0;
     43 
     44   // Emulates the ready message from window manager.
     45   virtual void EmulateWindowManagerReady() = 0;
     46 
     47   // Returns the widget for screen locker window.
     48   virtual views::Widget* GetWidget() const = 0;
     49 
     50   virtual views::Widget* GetChildWidget() const = 0;
     51 };
     52 
     53 }  // namespace test
     54 
     55 }  // namespace chromeos
     56 
     57 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_
     58