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

Side by Side Diff: extensions/browser/api/sockets_udp/sockets_udp_api_unittest.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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 "base/memory/scoped_ptr.h"
5 #include "base/values.h" 6 #include "base/values.h"
6 #include "extensions/browser/api/api_resource_manager.h" 7 #include "extensions/browser/api/api_resource_manager.h"
7 #include "extensions/browser/api/socket/socket.h" 8 #include "extensions/browser/api/socket/socket.h"
8 #include "extensions/browser/api/socket/udp_socket.h" 9 #include "extensions/browser/api/socket/udp_socket.h"
9 #include "extensions/browser/api/sockets_udp/sockets_udp_api.h" 10 #include "extensions/browser/api/sockets_udp/sockets_udp_api.h"
10 #include "extensions/browser/api_unittest.h" 11 #include "extensions/browser/api_unittest.h"
11 #include "testing/gmock/include/gmock/gmock.h" 12 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace extensions { 15 namespace extensions {
15 namespace core_api { 16 namespace core_api {
16 17
17 static KeyedService* ApiResourceManagerTestFactory( 18 static scoped_ptr<KeyedService> ApiResourceManagerTestFactory(
18 content::BrowserContext* context) { 19 content::BrowserContext* context) {
19 content::BrowserThread::ID id; 20 content::BrowserThread::ID id;
20 CHECK(content::BrowserThread::GetCurrentThreadIdentifier(&id)); 21 CHECK(content::BrowserThread::GetCurrentThreadIdentifier(&id));
21 return ApiResourceManager< 22 return ApiResourceManager<
22 ResumableUDPSocket>::CreateApiResourceManagerForTest(context, id); 23 ResumableUDPSocket>::CreateApiResourceManagerForTest(context, id);
23 } 24 }
24 25
25 class SocketsUdpUnitTest : public ApiUnitTest { 26 class SocketsUdpUnitTest : public ApiUnitTest {
26 public: 27 public:
27 void SetUp() override { 28 void SetUp() override {
(...skipping 15 matching lines...) Expand all
43 function->set_work_thread_id(id); 44 function->set_work_thread_id(id);
44 45
45 // Run tests 46 // Run tests
46 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary( 47 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary(
47 function, "[{\"persistent\": true, \"name\": \"foo\"}]")); 48 function, "[{\"persistent\": true, \"name\": \"foo\"}]"));
48 ASSERT_TRUE(result.get()); 49 ASSERT_TRUE(result.get());
49 } 50 }
50 51
51 } // namespace core_api 52 } // namespace core_api
52 } // namespace extensions 53 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.cc ('k') | extensions/browser/api/storage/storage_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698