test_mouse_lock.h 960 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2012 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. #ifndef PPAPI_TESTS_TEST_MOUSE_LOCK_H_
  5. #define PPAPI_TESTS_TEST_MOUSE_LOCK_H_
  6. #include <string>
  7. #include "ppapi/cpp/mouse_lock.h"
  8. #include "ppapi/cpp/rect.h"
  9. #include "ppapi/tests/test_case.h"
  10. #include "ppapi/tests/test_utils.h"
  11. class TestMouseLock: public TestCase, public pp::MouseLock {
  12. public:
  13. explicit TestMouseLock(TestingInstance* instance);
  14. virtual ~TestMouseLock();
  15. // TestCase implementation.
  16. virtual bool Init();
  17. virtual void RunTests(const std::string& filter);
  18. virtual void DidChangeView(const pp::View& view);
  19. // pp::MouseLock implementation.
  20. virtual void MouseLockLost();
  21. private:
  22. std::string TestSucceedWhenAllowed();
  23. void SimulateUserGesture();
  24. pp::Rect position_;
  25. NestedEvent nested_event_;
  26. };
  27. #endif // PPAPI_TESTS_TEST_MOUSE_LOCK_H_