| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "content/browser/gamepad/gamepad_data_fetcher.h" | 8 #include "content/browser/gamepad/gamepad_data_fetcher.h" |
| 9 #include "content/browser/gamepad/gamepad_provider.h" | 9 #include "content/browser/gamepad/gamepad_provider.h" |
| 10 #include "content/browser/gamepad/gamepad_test_helpers.h" | 10 #include "content/browser/gamepad/gamepad_test_helpers.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 EXPECT_EQ(1u, output.length); | 104 EXPECT_EQ(1u, output.length); |
| 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]); | 106 EXPECT_EQ(1.f, output.items[0].buttons[0]); |
| 107 EXPECT_EQ(2u, output.items[0].axesLength); | 107 EXPECT_EQ(2u, output.items[0].axesLength); |
| 108 EXPECT_EQ(-1.f, output.items[0].axes[0]); | 108 EXPECT_EQ(-1.f, output.items[0].axes[0]); |
| 109 EXPECT_EQ(0.5f, output.items[0].axes[1]); | 109 EXPECT_EQ(0.5f, output.items[0].axes[1]); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Tests that waiting for a user gesture works properly. | 112 // Tests that waiting for a user gesture works properly. |
| 113 TEST_F(GamepadProviderTest, UserGesture) { | 113 TEST_F(GamepadProviderTest, DISABLED_UserGesture) { |
| 114 WebGamepads no_button_data; | 114 WebGamepads no_button_data; |
| 115 no_button_data.length = 1; | 115 no_button_data.length = 1; |
| 116 no_button_data.items[0].connected = true; | 116 no_button_data.items[0].connected = true; |
| 117 no_button_data.items[0].timestamp = 0; | 117 no_button_data.items[0].timestamp = 0; |
| 118 no_button_data.items[0].buttonsLength = 1; | 118 no_button_data.items[0].buttonsLength = 1; |
| 119 no_button_data.items[0].axesLength = 2; | 119 no_button_data.items[0].axesLength = 2; |
| 120 no_button_data.items[0].buttons[0] = 0.f; | 120 no_button_data.items[0].buttons[0] = 0.f; |
| 121 no_button_data.items[0].axes[0] = -1.f; | 121 no_button_data.items[0].axes[0] = -1.f; |
| 122 no_button_data.items[0].axes[1] = .5f; | 122 no_button_data.items[0].axes[1] = .5f; |
| 123 | 123 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 150 mock_data_fetcher_->WaitForDataRead(); | 150 mock_data_fetcher_->WaitForDataRead(); |
| 151 | 151 |
| 152 // It should have issued our callback. | 152 // It should have issued our callback. |
| 153 message_loop().RunUntilIdle(); | 153 message_loop().RunUntilIdle(); |
| 154 EXPECT_TRUE(listener.has_user_gesture()); | 154 EXPECT_TRUE(listener.has_user_gesture()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace | 157 } // namespace |
| 158 | 158 |
| 159 } // namespace content | 159 } // namespace content |
| OLD | NEW |