| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 mock_data_fetcher_->SetTestData(button_down_data); | 140 mock_data_fetcher_->SetTestData(button_down_data); |
| 141 mock_data_fetcher_->WaitForDataReadAndCallbacksIssued(); | 141 mock_data_fetcher_->WaitForDataReadAndCallbacksIssued(); |
| 142 | 142 |
| 143 // It should have issued our callback. | 143 // It should have issued our callback. |
| 144 base::RunLoop().RunUntilIdle(); | 144 base::RunLoop().RunUntilIdle(); |
| 145 EXPECT_TRUE(listener.has_user_gesture()); | 145 EXPECT_TRUE(listener.has_user_gesture()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Crashes. http://crbug.com/106163 | 148 // Crashes. http://crbug.com/106163 |
| 149 // crbug.com/147549 | 149 // crbug.com/147549 |
| 150 // Flaky on MSAN: http://crbug.com/640086 |
| 150 #if defined(OS_ANDROID) | 151 #if defined(OS_ANDROID) |
| 151 #define MAYBE_Sanitization DISABLED_Sanitization | 152 #define MAYBE_Sanitization DISABLED_Sanitization |
| 153 #elif defined(MEMORY_SANITIZER) |
| 154 #define MAYBE_Sanitization DISABLED_Sanitization |
| 152 #else | 155 #else |
| 153 #define MAYBE_Sanitization Sanitization | 156 #define MAYBE_Sanitization Sanitization |
| 154 #endif | 157 #endif |
| 155 // Tests that waiting for a user gesture works properly. | 158 // Tests that waiting for a user gesture works properly. |
| 156 TEST_F(GamepadProviderTest, MAYBE_Sanitization) { | 159 TEST_F(GamepadProviderTest, MAYBE_Sanitization) { |
| 157 WebGamepads active_data; | 160 WebGamepads active_data; |
| 158 active_data.length = 1; | 161 active_data.length = 1; |
| 159 active_data.items[0].connected = true; | 162 active_data.items[0].connected = true; |
| 160 active_data.items[0].timestamp = 0; | 163 active_data.items[0].timestamp = 0; |
| 161 active_data.items[0].buttonsLength = 1; | 164 active_data.items[0].buttonsLength = 1; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 EXPECT_EQ(1u, output->items[0].buttonsLength); | 226 EXPECT_EQ(1u, output->items[0].buttonsLength); |
| 224 EXPECT_EQ(1.f, output->items[0].buttons[0].value); | 227 EXPECT_EQ(1.f, output->items[0].buttons[0].value); |
| 225 EXPECT_TRUE(output->items[0].buttons[0].pressed); | 228 EXPECT_TRUE(output->items[0].buttons[0].pressed); |
| 226 EXPECT_EQ(1u, output->items[0].axesLength); | 229 EXPECT_EQ(1u, output->items[0].axesLength); |
| 227 EXPECT_EQ(-1.f, output->items[0].axes[0]); | 230 EXPECT_EQ(-1.f, output->items[0].axes[0]); |
| 228 } | 231 } |
| 229 | 232 |
| 230 } // namespace | 233 } // namespace |
| 231 | 234 |
| 232 } // namespace device | 235 } // namespace device |
| OLD | NEW |