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

Side by Side Diff: remoting/client/input/touch_input_scaler_unittest.cc

Issue 2903623002: Moving input related classes to the input folder. (Closed)
Patch Set: Hide gesture code from nacl. Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/client/touch_input_scaler.h" 5 #include "remoting/client/input/touch_input_scaler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "remoting/protocol/protocol_mock_objects.h" 12 #include "remoting/protocol/protocol_mock_objects.h"
13 #include "remoting/protocol/test_event_matchers.h" 13 #include "remoting/protocol/test_event_matchers.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 21 matching lines...) Expand all
37 : PointInfo(x, y, kDefaultRadius, kDefaultRadius) {} 37 : PointInfo(x, y, kDefaultRadius, kDefaultRadius) {}
38 PointInfo(float x, float y, float radius_x, float radius_y) 38 PointInfo(float x, float y, float radius_x, float radius_y)
39 : x(x), y(y), radius_x(radius_x), radius_y(radius_y) {} 39 : x(x), y(y), radius_x(radius_x), radius_y(radius_y) {}
40 40
41 float x; 41 float x;
42 float y; 42 float y;
43 float radius_x; 43 float radius_x;
44 float radius_y; 44 float radius_y;
45 }; 45 };
46 46
47 const PointInfo kDefaultPointInfo = {kDefaultXCoord, 47 const PointInfo kDefaultPointInfo = {kDefaultXCoord, kDefaultYCoord,
48 kDefaultYCoord, 48 kDefaultRadius, kDefaultRadius};
49 kDefaultRadius,
50 kDefaultRadius};
51 49
52 } // namespace 50 } // namespace
53 51
54 class TouchInputScalerTest : public ::testing::Test { 52 class TouchInputScalerTest : public ::testing::Test {
55 protected: 53 protected:
56 TouchInputScalerTest() : touch_input_scaler_(&mock_stub_) {} 54 TouchInputScalerTest() : touch_input_scaler_(&mock_stub_) {}
57 55
58 void AddInputCoordinate(const PointInfo& point_info) { 56 void AddInputCoordinate(const PointInfo& point_info) {
59 point_infos_.push_back(point_info); 57 point_infos_.push_back(point_info);
60 } 58 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 point->set_radius_x(2.666f); 366 point->set_radius_x(2.666f);
369 point->set_radius_y(1.0f); 367 point->set_radius_y(1.0f);
370 368
371 EXPECT_CALL(mock_stub_, 369 EXPECT_CALL(mock_stub_,
372 InjectTouchEvent(AllOf(EqualsTouchPointCoordinates(expected_out), 370 InjectTouchEvent(AllOf(EqualsTouchPointCoordinates(expected_out),
373 EqualsTouchPointRadii(expected_out)))); 371 EqualsTouchPointRadii(expected_out))));
374 InjectTestTouchEvent(); 372 InjectTestTouchEvent();
375 } 373 }
376 374
377 } // namespace remoting 375 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698