OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "ppapi/tests/test_mouse_lock.h" | 5 #include "ppapi/tests/test_mouse_lock.h" |
6 | 6 |
7 #include "ppapi/cpp/input_event.h" | 7 #include "ppapi/cpp/input_event.h" |
8 #include "ppapi/cpp/view.h" | 8 #include "ppapi/cpp/view.h" |
9 #include "ppapi/tests/testing_instance.h" | 9 #include "ppapi/tests/testing_instance.h" |
10 | 10 |
11 REGISTER_TEST_CASE(MouseLock); | 11 REGISTER_TEST_CASE(MouseLock); |
12 | 12 |
13 TestMouseLock::TestMouseLock(TestingInstance* instance) | 13 TestMouseLock::TestMouseLock(TestingInstance* instance) |
14 : TestCase(instance), | 14 : TestCase(instance), |
15 MouseLock(instance), | 15 MouseLock(instance), |
16 nested_event_(instance->pp_instance()) { | 16 nested_event_(instance->pp_instance()) { |
17 } | 17 } |
18 | 18 |
19 TestMouseLock::~TestMouseLock() { | 19 TestMouseLock::~TestMouseLock() { |
20 } | 20 } |
21 | 21 |
22 bool TestMouseLock::Init() { | 22 bool TestMouseLock::Init() { |
23 return CheckTestingInterface(); | 23 return CheckTestingInterface(); |
24 } | 24 } |
25 | 25 |
26 void TestMouseLock::RunTests(const std::string& filter) { | 26 void TestMouseLock::RunTests(const std::string& filter) { |
27 // Disabled due to timeouts: http://crbug.com/136548 | 27 RUN_TEST(SucceedWhenAllowed, filter); |
28 // RUN_TEST(SucceedWhenAllowed, filter); | |
29 RUN_TEST(FailWhenBlocked, filter); | 28 RUN_TEST(FailWhenBlocked, filter); |
30 } | 29 } |
31 | 30 |
32 void TestMouseLock::DidChangeView(const pp::View& view) { | 31 void TestMouseLock::DidChangeView(const pp::View& view) { |
33 position_ = view.GetRect(); | 32 position_ = view.GetRect(); |
34 } | 33 } |
35 | 34 |
36 void TestMouseLock::MouseLockLost() { | 35 void TestMouseLock::MouseLockLost() { |
37 nested_event_.Signal(); | 36 nested_event_.Signal(); |
38 } | 37 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 0, // time_stamp | 70 0, // time_stamp |
72 0, // modifiers | 71 0, // modifiers |
73 PP_INPUTEVENT_MOUSEBUTTON_LEFT, | 72 PP_INPUTEVENT_MOUSEBUTTON_LEFT, |
74 position_.CenterPoint(), | 73 position_.CenterPoint(), |
75 1, // click_count | 74 1, // click_count |
76 mouse_movement); | 75 mouse_movement); |
77 | 76 |
78 testing_interface_->SimulateInputEvent(instance_->pp_instance(), | 77 testing_interface_->SimulateInputEvent(instance_->pp_instance(), |
79 input_event.pp_resource()); | 78 input_event.pp_resource()); |
80 } | 79 } |
OLD | NEW |