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/renderer/mouse_lock_dispatcher.h" | 9 #include "content/renderer/mouse_lock_dispatcher.h" |
9 #include "content/renderer/render_view_impl.h" | 10 #include "content/renderer/render_view_impl.h" |
10 #include "content/test/render_view_test.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 | 13 |
14 using ::testing::_; | 14 using ::testing::_; |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class MockLockTarget : public MouseLockDispatcher::LockTarget { | 18 class MockLockTarget : public MouseLockDispatcher::LockTarget { |
19 public: | 19 public: |
20 MOCK_METHOD1(OnLockMouseACK, void(bool)); | 20 MOCK_METHOD1(OnLockMouseACK, void(bool)); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 EXPECT_TRUE(dispatcher()->IsMouseLockedTo(target_)); | 223 EXPECT_TRUE(dispatcher()->IsMouseLockedTo(target_)); |
224 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(alternate_target_)); | 224 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(alternate_target_)); |
225 | 225 |
226 // Though the call to UnlockMouse should not unlock any target, we will | 226 // Though the call to UnlockMouse should not unlock any target, we will |
227 // cause an unlock (as if e.g. user escaped mouse lock) and verify the | 227 // cause an unlock (as if e.g. user escaped mouse lock) and verify the |
228 // correct target is unlocked. | 228 // correct target is unlocked. |
229 view()->OnMessageReceived(ViewMsg_MouseLockLost(route_id_)); | 229 view()->OnMessageReceived(ViewMsg_MouseLockLost(route_id_)); |
230 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(target_)); | 230 EXPECT_FALSE(dispatcher()->IsMouseLockedTo(target_)); |
231 } | 231 } |
232 | 232 |
OLD | NEW |