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

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_apitest.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 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 <map> 5 #include <map>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 11 #include "chrome/browser/extensions/extension_apitest.h"
11 #include "components/keyed_service/core/keyed_service.h" 12 #include "components/keyed_service/core/keyed_service.h"
12 #include "components/onc/onc_constants.h" 13 #include "components/onc/onc_constants.h"
13 #include "content/public/test/test_utils.h" 14 #include "content/public/test/test_utils.h"
14 #include "extensions/browser/api/networking_private/networking_private_delegate. h" 15 #include "extensions/browser/api/networking_private/networking_private_delegate. h"
15 #include "extensions/browser/api/networking_private/networking_private_delegate_ factory.h" 16 #include "extensions/browser/api/networking_private/networking_private_delegate_ factory.h"
16 #include "extensions/common/switches.h" 17 #include "extensions/common/switches.h"
17 18
18 namespace extensions { 19 namespace extensions {
19 20
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 NetworkingPrivateApiTest() { 270 NetworkingPrivateApiTest() {
270 if (!s_test_delegate_) { 271 if (!s_test_delegate_) {
271 TestVerifyDelegate* verify_delegate = new TestVerifyDelegate; 272 TestVerifyDelegate* verify_delegate = new TestVerifyDelegate;
272 scoped_ptr<NetworkingPrivateDelegate::VerifyDelegate> verify_delegate_ptr( 273 scoped_ptr<NetworkingPrivateDelegate::VerifyDelegate> verify_delegate_ptr(
273 verify_delegate); 274 verify_delegate);
274 s_test_delegate_ = new TestDelegate(verify_delegate_ptr.Pass()); 275 s_test_delegate_ = new TestDelegate(verify_delegate_ptr.Pass());
275 verify_delegate->set_owner(s_test_delegate_); 276 verify_delegate->set_owner(s_test_delegate_);
276 } 277 }
277 } 278 }
278 279
279 static KeyedService* GetNetworkingPrivateDelegate( 280 static scoped_ptr<KeyedService> GetNetworkingPrivateDelegate(
280 content::BrowserContext* profile) { 281 content::BrowserContext* profile) {
281 CHECK(s_test_delegate_); 282 CHECK(s_test_delegate_);
282 return s_test_delegate_; 283 return make_scoped_ptr(s_test_delegate_);
283 } 284 }
284 285
285 void SetUpCommandLine(base::CommandLine* command_line) override { 286 void SetUpCommandLine(base::CommandLine* command_line) override {
286 ExtensionApiTest::SetUpCommandLine(command_line); 287 ExtensionApiTest::SetUpCommandLine(command_line);
287 // Whitelist the extension ID of the test extension. 288 // Whitelist the extension ID of the test extension.
288 command_line->AppendSwitchASCII( 289 command_line->AppendSwitchASCII(
289 extensions::switches::kWhitelistedExtensionID, 290 extensions::switches::kWhitelistedExtensionID,
290 "epcifkihnkjgphfkloaaleeakhpmgdmn"); 291 "epcifkihnkjgphfkloaaleeakhpmgdmn");
291 } 292 }
292 293
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 EXPECT_FALSE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; 519 EXPECT_FALSE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_;
519 } 520 }
520 521
521 IN_PROC_BROWSER_TEST_F(NetworkingPrivateApiTestFail, GetCaptivePortalStatus) { 522 IN_PROC_BROWSER_TEST_F(NetworkingPrivateApiTestFail, GetCaptivePortalStatus) {
522 EXPECT_FALSE(RunNetworkingSubtest("getCaptivePortalStatus")) << message_; 523 EXPECT_FALSE(RunNetworkingSubtest("getCaptivePortalStatus")) << message_;
523 } 524 }
524 525
525 #endif // defined(OS_WIN) 526 #endif // defined(OS_WIN)
526 527
527 } // namespace extensions 528 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698