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

Side by Side Diff: chrome/browser/extensions/api/gcd_private/gcd_private_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 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h" 8 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/local_discovery/test_service_discovery_client.h" 10 #include "chrome/browser/local_discovery/test_service_discovery_client.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 base::Bind(&GcdPrivateAPITest::CreateFakeURLFetcher, 84 base::Bind(&GcdPrivateAPITest::CreateFakeURLFetcher,
85 base::Unretained(this))) {} 85 base::Unretained(this))) {}
86 86
87 void SetUpCommandLine(base::CommandLine* command_line) override { 87 void SetUpCommandLine(base::CommandLine* command_line) override {
88 ExtensionApiTest::SetUpCommandLine(command_line); 88 ExtensionApiTest::SetUpCommandLine(command_line);
89 command_line->AppendSwitchASCII( 89 command_line->AppendSwitchASCII(
90 extensions::switches::kWhitelistedExtensionID, 90 extensions::switches::kWhitelistedExtensionID,
91 "ddchlicdkolnonkihahngkmmmjnjlkkf"); 91 "ddchlicdkolnonkihahngkmmmjnjlkkf");
92 } 92 }
93 93
94 scoped_ptr<net::FakeURLFetcher> CreateFakeURLFetcher( 94 std::unique_ptr<net::FakeURLFetcher> CreateFakeURLFetcher(
95 const GURL& url, 95 const GURL& url,
96 net::URLFetcherDelegate* fetcher_delegate, 96 net::URLFetcherDelegate* fetcher_delegate,
97 const std::string& response_data, 97 const std::string& response_data,
98 net::HttpStatusCode response_code, 98 net::HttpStatusCode response_code,
99 net::URLRequestStatus::Status status) { 99 net::URLRequestStatus::Status status) {
100 scoped_ptr<net::FakeURLFetcher> fetcher(new net::FakeURLFetcher( 100 std::unique_ptr<net::FakeURLFetcher> fetcher(new net::FakeURLFetcher(
101 url, fetcher_delegate, response_data, response_code, status)); 101 url, fetcher_delegate, response_data, response_code, status));
102 scoped_refptr<net::HttpResponseHeaders> headers = 102 scoped_refptr<net::HttpResponseHeaders> headers =
103 new net::HttpResponseHeaders(""); 103 new net::HttpResponseHeaders("");
104 headers->AddHeader("Content-Type: application/json"); 104 headers->AddHeader("Content-Type: application/json");
105 fetcher->set_response_headers(headers); 105 fetcher->set_response_headers(headers);
106 return fetcher; 106 return fetcher;
107 } 107 }
108 108
109 protected: 109 protected:
110 net::URLFetcherImplFactory url_fetcher_impl_factory_; 110 net::URLFetcherImplFactory url_fetcher_impl_factory_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 test_service_discovery_client_->SimulateReceive(kAnnouncePacket, 154 test_service_discovery_client_->SimulateReceive(kAnnouncePacket,
155 sizeof(kAnnouncePacket)); 155 sizeof(kAnnouncePacket));
156 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"), 156 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"),
157 kPrivetInfoResponse, 157 kPrivetInfoResponse,
158 net::HTTP_OK, 158 net::HTTP_OK,
159 net::URLRequestStatus::SUCCESS); 159 net::URLRequestStatus::SUCCESS);
160 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "session.html")); 160 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "session.html"));
161 } 161 }
162 162
163 } // namespace 163 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698