| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 // Set a button down and wait for it to be read twice. | 200 // Set a button down and wait for it to be read twice. |
| 201 mock_data_fetcher_->SetTestData(button_down_data); | 201 mock_data_fetcher_->SetTestData(button_down_data); |
| 202 mock_data_fetcher_->WaitForDataReadAndCallbacksIssued(); | 202 mock_data_fetcher_->WaitForDataReadAndCallbacksIssued(); |
| 203 | 203 |
| 204 // It should have issued our callback. | 204 // It should have issued our callback. |
| 205 base::RunLoop().RunUntilIdle(); | 205 base::RunLoop().RunUntilIdle(); |
| 206 EXPECT_TRUE(listener.has_user_gesture()); | 206 EXPECT_TRUE(listener.has_user_gesture()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Flaky on MSAN: http://crbug.com/640086 | 209 // Flaky on CrOS and Linux: http://crbug.com/640086, https://crbug.com/702712 |
| 210 #if defined(MEMORY_SANITIZER) | 210 #if defined(OS_LINUX) || defined(OS_CHROMEOS) |
| 211 #define MAYBE_Sanitization DISABLED_Sanitization | 211 #define MAYBE_Sanitization DISABLED_Sanitization |
| 212 #else | 212 #else |
| 213 #define MAYBE_Sanitization Sanitization | 213 #define MAYBE_Sanitization Sanitization |
| 214 #endif | 214 #endif |
| 215 // Tests that waiting for a user gesture works properly. | 215 // Tests that waiting for a user gesture works properly. |
| 216 TEST_F(GamepadProviderTest, MAYBE_Sanitization) { | 216 TEST_F(GamepadProviderTest, MAYBE_Sanitization) { |
| 217 WebGamepads active_data; | 217 WebGamepads active_data; |
| 218 active_data.items[0].connected = true; | 218 active_data.items[0].connected = true; |
| 219 active_data.items[0].timestamp = 0; | 219 active_data.items[0].timestamp = 0; |
| 220 active_data.items[0].buttonsLength = 1; | 220 active_data.items[0].buttonsLength = 1; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 EXPECT_EQ(1u, output.items[0].buttonsLength); | 286 EXPECT_EQ(1u, output.items[0].buttonsLength); |
| 287 EXPECT_EQ(1.f, output.items[0].buttons[0].value); | 287 EXPECT_EQ(1.f, output.items[0].buttons[0].value); |
| 288 EXPECT_TRUE(output.items[0].buttons[0].pressed); | 288 EXPECT_TRUE(output.items[0].buttons[0].pressed); |
| 289 EXPECT_EQ(1u, output.items[0].axesLength); | 289 EXPECT_EQ(1u, output.items[0].axesLength); |
| 290 EXPECT_EQ(-1.f, output.items[0].axes[0]); | 290 EXPECT_EQ(-1.f, output.items[0].axes[0]); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace | 293 } // namespace |
| 294 | 294 |
| 295 } // namespace device | 295 } // namespace device |
| OLD | NEW |