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

Side by Side Diff: content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/bluetooth/frame_connected_bluetooth_devices.h" 5 #include "content/browser/bluetooth/frame_connected_bluetooth_devices.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "content/browser/bluetooth/web_bluetooth_service_impl.h" 9 #include "content/browser/bluetooth/web_bluetooth_service_impl.h"
10 #include "content/test/test_render_view_host.h" 10 #include "content/test/test_render_view_host.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void TearDown() override { 87 void TearDown() override {
88 map1_ = nullptr; 88 map1_ = nullptr;
89 service1_ = nullptr; 89 service1_ = nullptr;
90 map0_ = nullptr; 90 map0_ = nullptr;
91 service0_ = nullptr; 91 service0_ = nullptr;
92 RenderViewHostImplTestHarness::TearDown(); 92 RenderViewHostImplTestHarness::TearDown();
93 } 93 }
94 94
95 std::unique_ptr<NiceMockBluetoothGattConnection> GetConnection( 95 std::unique_ptr<NiceMockBluetoothGattConnection> GetConnection(
96 const std::string& address) { 96 const std::string& address) {
97 return base::WrapUnique( 97 return base::MakeUnique<NiceMockBluetoothGattConnection>(adapter_.get(),
98 new NiceMockBluetoothGattConnection(adapter_.get(), address)); 98 address);
99 } 99 }
100 100
101 void ResetService0() { 101 void ResetService0() {
102 service0_->ClearState(); 102 service0_->ClearState();
103 map0_ = nullptr; 103 map0_ = nullptr;
104 } 104 }
105 105
106 void ResetService1() { 106 void ResetService1() {
107 service1_->ClearState(); 107 service1_->ClearState();
108 map1_ = nullptr; 108 map1_ = nullptr;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 TEST_F(FrameConnectedBluetoothDevicesTest, 385 TEST_F(FrameConnectedBluetoothDevicesTest,
386 DestroyedByWebContentsImplDestruction) { 386 DestroyedByWebContentsImplDestruction) {
387 // Tests that we don't crash when FrameConnectedBluetoothDevices contains 387 // Tests that we don't crash when FrameConnectedBluetoothDevices contains
388 // at least one device, and it is destroyed while WebContentsImpl is being 388 // at least one device, and it is destroyed while WebContentsImpl is being
389 // destroyed. 389 // destroyed.
390 map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0)); 390 map0_->Insert(kDeviceId0, GetConnection(kDeviceAddress0));
391 DeleteContents(); 391 DeleteContents();
392 } 392 }
393 393
394 } // namespace content 394 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/blob_storage/blob_url_request_job_unittest.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698