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

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

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 months 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 | Annotate | Revision Log
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/renderer/mouse_lock_dispatcher.h" 8 #include "content/renderer/mouse_lock_dispatcher.h"
9 #include "content/renderer/render_view_impl.h" 9 #include "content/renderer/render_view_impl.h"
10 #include "content/test/render_view_test.h" 10 #include "content/test/render_view_test.h"
(...skipping 12 matching lines...) Expand all
23 bool(const WebKit::WebMouseEvent&)); 23 bool(const WebKit::WebMouseEvent&));
24 }; 24 };
25 25
26 // MouseLockDispatcher is a RenderViewObserver, and we test it by creating a 26 // MouseLockDispatcher is a RenderViewObserver, and we test it by creating a
27 // fixture containing a RenderViewImpl view() and interacting to that interface. 27 // fixture containing a RenderViewImpl view() and interacting to that interface.
28 class MouseLockDispatcherTest 28 class MouseLockDispatcherTest
29 : public content::RenderViewTest { 29 : public content::RenderViewTest {
30 public: 30 public:
31 virtual void SetUp() { 31 virtual void SetUp() {
32 content::RenderViewTest::SetUp(); 32 content::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 virtual void TearDown() {
39 content::RenderViewTest::TearDown(); 39 content::RenderViewTest::TearDown();
40 delete target_; 40 delete target_;
41 delete alternate_target_; 41 delete alternate_target_;
42 } 42 }
43 43
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « content/public/renderer/render_view.h ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698