Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: content/renderer/mouse_lock_dispatcher_browsertest.cc

Issue 686523002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 10 matching lines...) Expand all
21 MOCK_METHOD1(OnLockMouseACK, void(bool)); 21 MOCK_METHOD1(OnLockMouseACK, void(bool));
22 MOCK_METHOD0(OnMouseLockLost, void()); 22 MOCK_METHOD0(OnMouseLockLost, void());
23 MOCK_METHOD1(HandleMouseLockedInputEvent, 23 MOCK_METHOD1(HandleMouseLockedInputEvent,
24 bool(const blink::WebMouseEvent&)); 24 bool(const blink::WebMouseEvent&));
25 }; 25 };
26 26
27 // MouseLockDispatcher is a RenderViewObserver, and we test it by creating a 27 // MouseLockDispatcher is a RenderViewObserver, and we test it by creating a
28 // fixture containing a RenderViewImpl view() and interacting to that interface. 28 // fixture containing a RenderViewImpl view() and interacting to that interface.
29 class MouseLockDispatcherTest : public RenderViewTest { 29 class MouseLockDispatcherTest : public RenderViewTest {
30 public: 30 public:
31 virtual void SetUp() { 31 void SetUp() override {
32 RenderViewTest::SetUp(); 32 RenderViewTest::SetUp();
33 route_id_ = view()->GetRoutingID(); 33 route_id_ = view()->GetRoutingID();
34 target_ = new MockLockTarget(); 34 target_ = new MockLockTarget();
35 alternate_target_ = new MockLockTarget(); 35 alternate_target_ = new MockLockTarget();
36 } 36 }
37 37
38 virtual void TearDown() { 38 void TearDown() override {
39 RenderViewTest::TearDown(); 39 RenderViewTest::TearDown();
40 delete target_; 40 delete target_;
41 delete alternate_target_; 41 delete alternate_target_;
42 } 42 }
43 43
44 protected: 44 protected:
45 RenderViewImpl* view() { return static_cast<RenderViewImpl*>(view_); } 45 RenderViewImpl* view() { return static_cast<RenderViewImpl*>(view_); }
46 MouseLockDispatcher* dispatcher() { return view()->mouse_lock_dispatcher(); } 46 MouseLockDispatcher* dispatcher() { return view()->mouse_lock_dispatcher(); }
47 int route_id_; 47 int route_id_;
48 MockLockTarget* target_; 48 MockLockTarget* target_;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
233 } // namespace content 233 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_local_audio_track_unittest.cc ('k') | content/renderer/pepper/host_var_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698