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

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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 <memory>
5 #include <utility> 6 #include <utility>
6 7
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/callback.h" 9 #include "base/callback.h"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/extensions/api/networking_private/networking_private_cr edentials_getter.h" 13 #include "chrome/browser/extensions/api/networking_private/networking_private_cr edentials_getter.h"
14 #include "chrome/browser/extensions/extension_apitest.h" 14 #include "chrome/browser/extensions/extension_apitest.h"
15 #include "components/user_manager/user.h" 15 #include "components/user_manager/user.h"
16 #include "components/user_manager/user_manager.h" 16 #include "components/user_manager/user_manager.h"
17 #include "components/wifi/fake_wifi_service.h" 17 #include "components/wifi/fake_wifi_service.h"
18 #include "content/public/test/test_utils.h" 18 #include "content/public/test/test_utils.h"
19 #include "extensions/browser/api/networking_private/networking_private_delegate_ factory.h" 19 #include "extensions/browser/api/networking_private/networking_private_delegate_ factory.h"
20 #include "extensions/browser/api/networking_private/networking_private_event_rou ter.h" 20 #include "extensions/browser/api/networking_private/networking_private_event_rou ter.h"
21 #include "extensions/browser/api/networking_private/networking_private_event_rou ter_factory.h" 21 #include "extensions/browser/api/networking_private/networking_private_event_rou ter_factory.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 void SetUpCommandLine(base::CommandLine* command_line) override { 81 void SetUpCommandLine(base::CommandLine* command_line) override {
82 ExtensionApiTest::SetUpCommandLine(command_line); 82 ExtensionApiTest::SetUpCommandLine(command_line);
83 // Whitelist the extension ID of the test extension. 83 // Whitelist the extension ID of the test extension.
84 command_line->AppendSwitchASCII( 84 command_line->AppendSwitchASCII(
85 extensions::switches::kWhitelistedExtensionID, 85 extensions::switches::kWhitelistedExtensionID,
86 "epcifkihnkjgphfkloaaleeakhpmgdmn"); 86 "epcifkihnkjgphfkloaaleeakhpmgdmn");
87 } 87 }
88 88
89 static scoped_ptr<KeyedService> CreateNetworkingPrivateServiceClient( 89 static std::unique_ptr<KeyedService> CreateNetworkingPrivateServiceClient(
90 content::BrowserContext* context) { 90 content::BrowserContext* context) {
91 scoped_ptr<wifi::FakeWiFiService> wifi_service(new wifi::FakeWiFiService()); 91 std::unique_ptr<wifi::FakeWiFiService> wifi_service(
92 scoped_ptr<CryptoVerifyStub> crypto_verify(new CryptoVerifyStub); 92 new wifi::FakeWiFiService());
93 return scoped_ptr<KeyedService>(new NetworkingPrivateServiceClient( 93 std::unique_ptr<CryptoVerifyStub> crypto_verify(new CryptoVerifyStub);
94 return std::unique_ptr<KeyedService>(new NetworkingPrivateServiceClient(
94 std::move(wifi_service), std::move(crypto_verify))); 95 std::move(wifi_service), std::move(crypto_verify)));
95 } 96 }
96 97
97 void SetUpOnMainThread() override { 98 void SetUpOnMainThread() override {
98 ExtensionApiTest::SetUpOnMainThread(); 99 ExtensionApiTest::SetUpOnMainThread();
99 content::RunAllPendingInMessageLoop(); 100 content::RunAllPendingInMessageLoop();
100 NetworkingPrivateDelegateFactory::GetInstance()->SetTestingFactory( 101 NetworkingPrivateDelegateFactory::GetInstance()->SetTestingFactory(
101 profile(), &CreateNetworkingPrivateServiceClient); 102 profile(), &CreateNetworkingPrivateServiceClient);
102 } 103 }
103 104
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 VerifyAndEncryptCredentials) { 213 VerifyAndEncryptCredentials) {
213 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptCredentials")) << message_; 214 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptCredentials")) << message_;
214 } 215 }
215 216
216 IN_PROC_BROWSER_TEST_F(NetworkingPrivateServiceClientApiTest, 217 IN_PROC_BROWSER_TEST_F(NetworkingPrivateServiceClientApiTest,
217 VerifyAndEncryptData) { 218 VerifyAndEncryptData) {
218 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptData")) << message_; 219 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptData")) << message_;
219 } 220 }
220 221
221 } // namespace 222 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698