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

Side by Side Diff: content/renderer/input/input_handler_proxy_unittest.cc

Issue 1129693002: Make Mac pinch thresholding apply only to zoom (Chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years, 7 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
« no previous file with comments | « content/renderer/input/input_handler_proxy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/input/input_handler_proxy.h" 5 #include "content/renderer/input/input_handler_proxy.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/trees/swap_promise_monitor.h" 9 #include "cc/trees/swap_promise_monitor.h"
10 #include "content/common/input/did_overscroll_params.h" 10 #include "content/common/input/did_overscroll_params.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 gesture_.data.pinchUpdate.scale = 1.5; 408 gesture_.data.pinchUpdate.scale = 1.5;
409 gesture_.x = 7; 409 gesture_.x = 7;
410 gesture_.y = 13; 410 gesture_.y = 13;
411 EXPECT_CALL(mock_input_handler_, PinchGestureUpdate(1.5, gfx::Point(7, 13))); 411 EXPECT_CALL(mock_input_handler_, PinchGestureUpdate(1.5, gfx::Point(7, 13)));
412 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 412 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
413 413
414 VERIFY_AND_RESET_MOCKS(); 414 VERIFY_AND_RESET_MOCKS();
415 415
416 gesture_.type = WebInputEvent::GesturePinchUpdate; 416 gesture_.type = WebInputEvent::GesturePinchUpdate;
417 gesture_.data.pinchUpdate.scale = 0.5; 417 gesture_.data.pinchUpdate.scale = 0.5;
418 gesture_.data.pinchUpdate.zoomDisabled = true;
419 gesture_.x = 9;
420 gesture_.y = 6;
421 EXPECT_EQ(InputHandlerProxy::DROP_EVENT,
422 input_handler_->HandleInputEvent(gesture_));
423 gesture_.data.pinchUpdate.zoomDisabled = false;
424
425 VERIFY_AND_RESET_MOCKS();
426
427 gesture_.type = WebInputEvent::GesturePinchUpdate;
428 gesture_.data.pinchUpdate.scale = 0.5;
418 gesture_.x = 9; 429 gesture_.x = 9;
419 gesture_.y = 6; 430 gesture_.y = 6;
420 EXPECT_CALL(mock_input_handler_, PinchGestureUpdate(.5, gfx::Point(9, 6))); 431 EXPECT_CALL(mock_input_handler_, PinchGestureUpdate(.5, gfx::Point(9, 6)));
421 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 432 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
422 433
423 VERIFY_AND_RESET_MOCKS(); 434 VERIFY_AND_RESET_MOCKS();
424 435
425 gesture_.type = WebInputEvent::GesturePinchEnd; 436 gesture_.type = WebInputEvent::GesturePinchEnd;
426 EXPECT_CALL(mock_input_handler_, PinchGestureEnd()); 437 EXPECT_CALL(mock_input_handler_, PinchGestureEnd());
427 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 438 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 EXPECT_CALL(mock_input_handler_, SetNeedsAnimate()); 2142 EXPECT_CALL(mock_input_handler_, SetNeedsAnimate());
2132 EXPECT_CALL(mock_client, DidAnimateForInput()); 2143 EXPECT_CALL(mock_client, DidAnimateForInput());
2133 base::TimeTicks time = base::TimeTicks() + base::TimeDelta::FromSeconds(10); 2144 base::TimeTicks time = base::TimeTicks() + base::TimeDelta::FromSeconds(10);
2134 input_handler_->Animate(time); 2145 input_handler_->Animate(time);
2135 2146
2136 testing::Mock::VerifyAndClearExpectations(&mock_client); 2147 testing::Mock::VerifyAndClearExpectations(&mock_client);
2137 } 2148 }
2138 2149
2139 } // namespace 2150 } // namespace
2140 } // namespace content 2151 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/input_handler_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698