Chromium Code Reviews| Index: content/browser/gamepad/gamepad_service_test_helpers.h |
| diff --git a/content/browser/gamepad/gamepad_service_test_helpers.h b/content/browser/gamepad/gamepad_service_test_helpers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9353fca83cb170c94dcdc8e339563a7fceaae141 |
| --- /dev/null |
| +++ b/content/browser/gamepad/gamepad_service_test_helpers.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_TEST_HELPERS_H_ |
|
scottmg
2016/07/01 22:25:39
Match up the guard with the filename.
|
| +#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_TEST_HELPERS_H_ |
| + |
| +#include "base/macros.h" |
| +#include "device/gamepad/gamepad_test_helpers.h" |
| +#include "third_party/WebKit/public/platform/WebGamepads.h" |
| + |
| +namespace content { |
| + |
| +class GamepadService; |
| + |
| +// Constructs a GamepadService with a mock data source. This bypasses the |
| +// global singleton for the gamepad service. |
| +class GamepadServiceTestConstructor : public device::GamepadTestHelper { |
| + public: |
| + explicit GamepadServiceTestConstructor(const blink::WebGamepads& test_data); |
| + ~GamepadServiceTestConstructor() override; |
| + |
| + GamepadService* gamepad_service() { return gamepad_service_; } |
| + device::MockGamepadDataFetcher* data_fetcher() { return data_fetcher_; } |
| + |
| + private: |
| + // Owning pointer (can't be a scoped_ptr due to private destructor). |
| + GamepadService* gamepad_service_; |
| + |
| + // Pointer owned by the provider (which is owned by the gamepad service). |
| + device::MockGamepadDataFetcher* data_fetcher_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(GamepadServiceTestConstructor); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_TEST_HELPERS_H_ |