| 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 "device/gamepad/gamepad_provider.h" | 5 #include "device/gamepad/gamepad_provider.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 ReadGamepadHardwareBuffer(buffer, &output); | 103 ReadGamepadHardwareBuffer(buffer, &output); |
| 104 | 104 |
| 105 EXPECT_EQ(1u, output.items[0].buttonsLength); | 105 EXPECT_EQ(1u, output.items[0].buttonsLength); |
| 106 EXPECT_EQ(1.f, output.items[0].buttons[0].value); | 106 EXPECT_EQ(1.f, output.items[0].buttons[0].value); |
| 107 EXPECT_EQ(true, output.items[0].buttons[0].pressed); | 107 EXPECT_EQ(true, output.items[0].buttons[0].pressed); |
| 108 EXPECT_EQ(2u, output.items[0].axesLength); | 108 EXPECT_EQ(2u, output.items[0].axesLength); |
| 109 EXPECT_EQ(-1.f, output.items[0].axes[0]); | 109 EXPECT_EQ(-1.f, output.items[0].axes[0]); |
| 110 EXPECT_EQ(0.5f, output.items[0].axes[1]); | 110 EXPECT_EQ(0.5f, output.items[0].axes[1]); |
| 111 } | 111 } |
| 112 | 112 |
| 113 TEST_F(GamepadProviderTest, ConnectDisconnectMultiple) { | 113 // Flaky on all platforms: http://crbug.com/692219 |
| 114 TEST_F(GamepadProviderTest, DISABLED_ConnectDisconnectMultiple) { |
| 114 WebGamepads test_data; | 115 WebGamepads test_data; |
| 115 test_data.items[0].connected = true; | 116 test_data.items[0].connected = true; |
| 116 test_data.items[0].timestamp = 0; | 117 test_data.items[0].timestamp = 0; |
| 117 test_data.items[0].axesLength = 2; | 118 test_data.items[0].axesLength = 2; |
| 118 test_data.items[0].axes[0] = -1.f; | 119 test_data.items[0].axes[0] = -1.f; |
| 119 test_data.items[0].axes[1] = .5f; | 120 test_data.items[0].axes[1] = .5f; |
| 120 | 121 |
| 121 test_data.items[1].connected = true; | 122 test_data.items[1].connected = true; |
| 122 test_data.items[1].timestamp = 0; | 123 test_data.items[1].timestamp = 0; |
| 123 test_data.items[1].axesLength = 2; | 124 test_data.items[1].axesLength = 2; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 EXPECT_EQ(1u, output.items[0].buttonsLength); | 286 EXPECT_EQ(1u, output.items[0].buttonsLength); |
| 286 EXPECT_EQ(1.f, output.items[0].buttons[0].value); | 287 EXPECT_EQ(1.f, output.items[0].buttons[0].value); |
| 287 EXPECT_TRUE(output.items[0].buttons[0].pressed); | 288 EXPECT_TRUE(output.items[0].buttons[0].pressed); |
| 288 EXPECT_EQ(1u, output.items[0].axesLength); | 289 EXPECT_EQ(1u, output.items[0].axesLength); |
| 289 EXPECT_EQ(-1.f, output.items[0].axes[0]); | 290 EXPECT_EQ(-1.f, output.items[0].axes[0]); |
| 290 } | 291 } |
| 291 | 292 |
| 292 } // namespace | 293 } // namespace |
| 293 | 294 |
| 294 } // namespace device | 295 } // namespace device |
| OLD | NEW |