| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 prompt()->Dismissed(); | 143 prompt()->Dismissed(); |
| 144 } | 144 } |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 class TestExtensionsAPIClient : public ShellExtensionsAPIClient { | 147 class TestExtensionsAPIClient : public ShellExtensionsAPIClient { |
| 148 public: | 148 public: |
| 149 TestExtensionsAPIClient() : ShellExtensionsAPIClient() {} | 149 TestExtensionsAPIClient() : ShellExtensionsAPIClient() {} |
| 150 | 150 |
| 151 std::unique_ptr<DevicePermissionsPrompt> CreateDevicePermissionsPrompt( | 151 std::unique_ptr<DevicePermissionsPrompt> CreateDevicePermissionsPrompt( |
| 152 content::WebContents* web_contents) const override { | 152 content::WebContents* web_contents) const override { |
| 153 return base::WrapUnique(new TestDevicePermissionsPrompt(web_contents)); | 153 return base::MakeUnique<TestDevicePermissionsPrompt>(web_contents); |
| 154 } | 154 } |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 class HidApiTest : public ShellApiTest { | 157 class HidApiTest : public ShellApiTest { |
| 158 public: | 158 public: |
| 159 void SetUpOnMainThread() override { | 159 void SetUpOnMainThread() override { |
| 160 ShellApiTest::SetUpOnMainThread(); | 160 ShellApiTest::SetUpOnMainThread(); |
| 161 | 161 |
| 162 // MockDeviceClient replaces ShellDeviceClient. | 162 // MockDeviceClient replaces ShellDeviceClient. |
| 163 device_client_.reset(new MockDeviceClient()); | 163 device_client_.reset(new MockDeviceClient()); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 ExtensionTestMessageListener remove_listener("removed", false); | 258 ExtensionTestMessageListener remove_listener("removed", false); |
| 259 device_client_->hid_service()->RemoveDevice(kTestDeviceIds[0]); | 259 device_client_->hid_service()->RemoveDevice(kTestDeviceIds[0]); |
| 260 ASSERT_TRUE(remove_listener.WaitUntilSatisfied()); | 260 ASSERT_TRUE(remove_listener.WaitUntilSatisfied()); |
| 261 | 261 |
| 262 ExtensionTestMessageListener add_listener("added", false); | 262 ExtensionTestMessageListener add_listener("added", false); |
| 263 AddDevice(kTestDeviceIds[0], 0x18D1, 0x58F0, true); | 263 AddDevice(kTestDeviceIds[0], 0x18D1, 0x58F0, true); |
| 264 ASSERT_TRUE(add_listener.WaitUntilSatisfied()); | 264 ASSERT_TRUE(add_listener.WaitUntilSatisfied()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace extensions | 267 } // namespace extensions |
| OLD | NEW |