Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: extensions/browser/api/usb/usb_apitest.cc

Issue 2252373002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/storage_api_unittest.cc ('k') | extensions/browser/event_listener_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698