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

Side by Side Diff: components/precache/core/precache_fetcher_unittest.cc

Issue 2110663002: components: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+one fix Created 4 years, 5 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 "components/precache/core/precache_fetcher.h" 5 #include "components/precache/core/precache_fetcher.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstring> 9 #include <cstring>
10 #include <memory> 10 #include <memory>
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 FakeResponseAction(const std::string& body, 166 FakeResponseAction(const std::string& body,
167 F modifier, 167 F modifier,
168 net::FakeURLFetcher** fetcher) 168 net::FakeURLFetcher** fetcher)
169 : body_(body), modifier_(modifier), fetcher_(fetcher) {} 169 : body_(body), modifier_(modifier), fetcher_(fetcher) {}
170 170
171 net::URLFetcher* Perform( 171 net::URLFetcher* Perform(
172 const testing::tuple<int, 172 const testing::tuple<int,
173 const GURL&, 173 const GURL&,
174 net::URLFetcher::RequestType, 174 net::URLFetcher::RequestType,
175 net::URLFetcherDelegate*>& args) { 175 net::URLFetcherDelegate*>& args) {
176 auto fetcher = new net::FakeURLFetcher( 176 auto* fetcher = new net::FakeURLFetcher(
177 testing::get<1>(args), testing::get<3>(args), body_, net::HTTP_OK, 177 testing::get<1>(args), testing::get<3>(args), body_, net::HTTP_OK,
178 net::URLRequestStatus::SUCCESS); 178 net::URLRequestStatus::SUCCESS);
179 modifier_(fetcher); 179 modifier_(fetcher);
180 if (fetcher_) 180 if (fetcher_)
181 *fetcher_ = fetcher; 181 *fetcher_ = fetcher;
182 return fetcher; 182 return fetcher;
183 } 183 }
184 184
185 private: 185 private:
186 std::string body_; 186 std::string body_;
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1145
1146 EXPECT_TRUE(precache_delegate_.was_on_done_called()); 1146 EXPECT_TRUE(precache_delegate_.was_on_done_called());
1147 1147
1148 // bad-manifest.com will have been completed. 1148 // bad-manifest.com will have been completed.
1149 EXPECT_THAT(histogram.GetAllSamples("Precache.Fetch.PercentCompleted"), 1149 EXPECT_THAT(histogram.GetAllSamples("Precache.Fetch.PercentCompleted"),
1150 ElementsAre(base::Bucket(100, 1))); 1150 ElementsAre(base::Bucket(100, 1)));
1151 histogram.ExpectTotalCount("Precache.Fetch.TimeToComplete", 1); 1151 histogram.ExpectTotalCount("Precache.Fetch.TimeToComplete", 1);
1152 } 1152 }
1153 1153
1154 } // namespace precache 1154 } // namespace precache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698