OLD | NEW |
(Empty) | |
| 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 ScreenOrientationClientMock_h |
| 6 #define ScreenOrientationClientMock_h |
| 7 |
| 8 #include "modules/screen_orientation/ScreenOrientationClient.h" |
| 9 #include "platform/Timer.h" |
| 10 |
| 11 namespace WebCore { |
| 12 |
| 13 class ScreenOrientationController; |
| 14 |
| 15 // Provides a mock object for the screen orientation client. |
| 16 class ScreenOrientationClientMock FINAL : public ScreenOrientationClient { |
| 17 public: |
| 18 ScreenOrientationClientMock(); |
| 19 virtual ~ScreenOrientationClientMock(); |
| 20 |
| 21 void setController(ScreenOrientationController*); |
| 22 void setScreenOrientation(ScreenOrientationValue); |
| 23 |
| 24 // ScreenOrientationClient API. |
| 25 virtual void lockOrientation(ScreenOrientationValues) OVERRIDE; |
| 26 virtual void unlockOrientation() OVERRIDE; |
| 27 |
| 28 private: |
| 29 void asyncUpdateController(); |
| 30 void controllerTimerFired(Timer<ScreenOrientationClientMock>*); |
| 31 void maybeUpdateOrientationAfterLocking(); |
| 32 |
| 33 Timer<ScreenOrientationClientMock> m_controllerTimer; |
| 34 ScreenOrientationController* m_controller; |
| 35 ScreenOrientationValue m_orientation; |
| 36 ScreenOrientationValues m_lockedOrientations; |
| 37 }; |
| 38 |
| 39 } // namespace WebCore |
| 40 |
| 41 #endif // ScreenOrientationClientMock_h |
OLD | NEW |