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 <string> | 5 #include <string> |
6 | 6 |
7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
8 #include "content/public/test/render_view_test.h" | 8 #include "content/public/test/render_view_test.h" |
9 #include "content/renderer/mouse_lock_dispatcher.h" | 9 #include "content/renderer/mouse_lock_dispatcher.h" |
10 #include "content/renderer/render_view_impl.h" | 10 #include "content/renderer/render_view_impl.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/WebKit/public/platform/WebMouseEvent.h" |
13 | 14 |
14 using ::testing::_; | 15 using ::testing::_; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 namespace { | 18 namespace { |
18 | 19 |
19 class MockLockTarget : public MouseLockDispatcher::LockTarget { | 20 class MockLockTarget : public MouseLockDispatcher::LockTarget { |
20 public: | 21 public: |
21 MOCK_METHOD1(OnLockMouseACK, void(bool)); | 22 MOCK_METHOD1(OnLockMouseACK, void(bool)); |
22 MOCK_METHOD0(OnMouseLockLost, void()); | 23 MOCK_METHOD0(OnMouseLockLost, void()); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(alternate_target_)); | 226 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(alternate_target_)); |
226 | 227 |
227 // Though the call to UnlockMouse should not unlock any target, we will | 228 // Though the call to UnlockMouse should not unlock any target, we will |
228 // cause an unlock (as if e.g. user escaped mouse lock) and verify the | 229 // cause an unlock (as if e.g. user escaped mouse lock) and verify the |
229 // correct target is unlocked. | 230 // correct target is unlocked. |
230 widget()->OnMessageReceived(ViewMsg_MouseLockLost(route_id_)); | 231 widget()->OnMessageReceived(ViewMsg_MouseLockLost(route_id_)); |
231 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(target_)); | 232 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(target_)); |
232 } | 233 } |
233 | 234 |
234 } // namespace content | 235 } // namespace content |
OLD | NEW |