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

Side by Side Diff: extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/api/sockets_tcp/sockets_tcp_api.h" 5 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "content/public/test/test_browser_context.h" 11 #include "content/public/test/test_browser_context.h"
12 #include "extensions/browser/api/api_resource_manager.h" 12 #include "extensions/browser/api/api_resource_manager.h"
13 #include "extensions/browser/api/socket/socket.h" 13 #include "extensions/browser/api/socket/socket.h"
14 #include "extensions/browser/api/socket/tcp_socket.h" 14 #include "extensions/browser/api/socket/tcp_socket.h"
15 #include "extensions/browser/api_unittest.h" 15 #include "extensions/browser/api_unittest.h"
16 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace extensions { 19 namespace extensions {
20 namespace api { 20 namespace api {
21 21
22 static std::unique_ptr<KeyedService> ApiResourceManagerTestFactory( 22 static std::unique_ptr<KeyedService> ApiResourceManagerTestFactory(
23 content::BrowserContext* context) { 23 content::BrowserContext* context) {
24 return base::WrapUnique(new ApiResourceManager<ResumableTCPSocket>(context)); 24 return base::MakeUnique<ApiResourceManager<ResumableTCPSocket>>(context);
25 } 25 }
26 26
27 class SocketsTcpUnitTest : public ApiUnitTest { 27 class SocketsTcpUnitTest : public ApiUnitTest {
28 public: 28 public:
29 void SetUp() override { 29 void SetUp() override {
30 ApiUnitTest::SetUp(); 30 ApiUnitTest::SetUp();
31 31
32 ApiResourceManager<ResumableTCPSocket>::GetFactoryInstance() 32 ApiResourceManager<ResumableTCPSocket>::GetFactoryInstance()
33 ->SetTestingFactoryAndUse(browser_context(), 33 ->SetTestingFactoryAndUse(browser_context(),
34 ApiResourceManagerTestFactory); 34 ApiResourceManagerTestFactory);
(...skipping 10 matching lines...) Expand all
45 function->set_work_thread_id(id); 45 function->set_work_thread_id(id);
46 46
47 // Run tests 47 // Run tests
48 std::unique_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary( 48 std::unique_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary(
49 function, "[{\"persistent\": true, \"name\": \"foo\"}]")); 49 function, "[{\"persistent\": true, \"name\": \"foo\"}]"));
50 ASSERT_TRUE(result.get()); 50 ASSERT_TRUE(result.get());
51 } 51 }
52 52
53 } // namespace api 53 } // namespace api
54 } // namespace extensions 54 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_connection.cc ('k') | extensions/browser/api/sockets_udp/sockets_udp_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698