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 "content/browser/gamepad/gamepad_data_fetcher.h" | 7 #include "content/browser/gamepad/gamepad_data_fetcher.h" |
8 #include "content/browser/gamepad/gamepad_provider.h" | 8 #include "content/browser/gamepad/gamepad_provider.h" |
9 #include "content/browser/gamepad/gamepad_test_helpers.h" | 9 #include "content/browser/gamepad/gamepad_test_helpers.h" |
10 #include "content/common/gamepad_hardware_buffer.h" | 10 #include "content/common/gamepad_hardware_buffer.h" |
11 #include "content/common/gamepad_messages.h" | 11 #include "content/common/gamepad_messages.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 using WebKit::WebGamepads; | 18 using blink::WebGamepads; |
19 | 19 |
20 // Helper class to generate and record user gesture callbacks. | 20 // Helper class to generate and record user gesture callbacks. |
21 class UserGestureListener { | 21 class UserGestureListener { |
22 public: | 22 public: |
23 UserGestureListener() | 23 UserGestureListener() |
24 : weak_factory_(this), | 24 : weak_factory_(this), |
25 has_user_gesture_(false) { | 25 has_user_gesture_(false) { |
26 } | 26 } |
27 | 27 |
28 base::Closure GetClosure() { | 28 base::Closure GetClosure() { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 mock_data_fetcher_->WaitForDataRead(); | 149 mock_data_fetcher_->WaitForDataRead(); |
150 | 150 |
151 // It should have issued our callback. | 151 // It should have issued our callback. |
152 message_loop().RunUntilIdle(); | 152 message_loop().RunUntilIdle(); |
153 EXPECT_TRUE(listener.has_user_gesture()); | 153 EXPECT_TRUE(listener.has_user_gesture()); |
154 } | 154 } |
155 | 155 |
156 } // namespace | 156 } // namespace |
157 | 157 |
158 } // namespace content | 158 } // namespace content |
OLD | NEW |