| 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 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 prompt()->Dismissed(); | 118 prompt()->Dismissed(); |
| 119 } | 119 } |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 class TestExtensionsAPIClient : public ShellExtensionsAPIClient { | 122 class TestExtensionsAPIClient : public ShellExtensionsAPIClient { |
| 123 public: | 123 public: |
| 124 TestExtensionsAPIClient() : ShellExtensionsAPIClient() {} | 124 TestExtensionsAPIClient() : ShellExtensionsAPIClient() {} |
| 125 | 125 |
| 126 std::unique_ptr<DevicePermissionsPrompt> CreateDevicePermissionsPrompt( | 126 std::unique_ptr<DevicePermissionsPrompt> CreateDevicePermissionsPrompt( |
| 127 content::WebContents* web_contents) const override { | 127 content::WebContents* web_contents) const override { |
| 128 return base::WrapUnique(new TestDevicePermissionsPrompt(web_contents)); | 128 return base::MakeUnique<TestDevicePermissionsPrompt>(web_contents); |
| 129 } | 129 } |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 class UsbApiTest : public ShellApiTest { | 132 class UsbApiTest : public ShellApiTest { |
| 133 public: | 133 public: |
| 134 void SetUpOnMainThread() override { | 134 void SetUpOnMainThread() override { |
| 135 ShellApiTest::SetUpOnMainThread(); | 135 ShellApiTest::SetUpOnMainThread(); |
| 136 | 136 |
| 137 // MockDeviceClient replaces ShellDeviceClient. | 137 // MockDeviceClient replaces ShellDeviceClient. |
| 138 device_client_.reset(new MockDeviceClient()); | 138 device_client_.reset(new MockDeviceClient()); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 TestExtensionsAPIClient test_api_client; | 274 TestExtensionsAPIClient test_api_client; |
| 275 ASSERT_TRUE(LoadApp("api_test/usb/get_user_selected_devices")); | 275 ASSERT_TRUE(LoadApp("api_test/usb/get_user_selected_devices")); |
| 276 ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); | 276 ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); |
| 277 | 277 |
| 278 device_client_->usb_service()->RemoveDevice(mock_device_); | 278 device_client_->usb_service()->RemoveDevice(mock_device_); |
| 279 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); | 279 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace extensions | 282 } // namespace extensions |
| OLD | NEW |