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

Side by Side Diff: chromeos/timezone/timezone_unittest.cc

Issue 2295663002: Replace deprecated ScopedVector<T> in chromeos::TimeZoneProvider (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chromeos/timezone/timezone_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 provider_(provider) {} 91 provider_(provider) {}
92 92
93 std::unique_ptr<net::FakeURLFetcher> CreateURLFetcher( 93 std::unique_ptr<net::FakeURLFetcher> CreateURLFetcher(
94 const GURL& url, 94 const GURL& url,
95 net::URLFetcherDelegate* delegate, 95 net::URLFetcherDelegate* delegate,
96 const std::string& response_data, 96 const std::string& response_data,
97 net::HttpStatusCode response_code, 97 net::HttpStatusCode response_code,
98 net::URLRequestStatus::Status status) { 98 net::URLRequestStatus::Status status) {
99 EXPECT_EQ(provider_->requests_.size(), 1U); 99 EXPECT_EQ(provider_->requests_.size(), 1U);
100 100
101 TimeZoneRequest* timezone_request = provider_->requests_[0]; 101 TimeZoneRequest* timezone_request = provider_->requests_[0].get();
102 102
103 const base::TimeDelta base_retry_interval = 103 const base::TimeDelta base_retry_interval =
104 base::TimeDelta::FromMilliseconds(kRequestRetryIntervalMilliSeconds); 104 base::TimeDelta::FromMilliseconds(kRequestRetryIntervalMilliSeconds);
105 timezone_request->set_retry_sleep_on_server_error_for_testing( 105 timezone_request->set_retry_sleep_on_server_error_for_testing(
106 base_retry_interval); 106 base_retry_interval);
107 timezone_request->set_retry_sleep_on_bad_response_for_testing( 107 timezone_request->set_retry_sleep_on_bad_response_for_testing(
108 base_retry_interval); 108 base_retry_interval);
109 109
110 ++attempts_; 110 ++attempts_;
111 if (attempts_ > require_retries_) { 111 if (attempts_ > require_retries_) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 TEST(TimeZoneResolverTest, CheckIntervals) { 292 TEST(TimeZoneResolverTest, CheckIntervals) {
293 for (int requests_count = 1; requests_count < 10; ++requests_count) { 293 for (int requests_count = 1; requests_count < 10; ++requests_count) {
294 EXPECT_EQ(requests_count, 294 EXPECT_EQ(requests_count,
295 TimeZoneResolver::MaxRequestsCountForIntervalForTesting( 295 TimeZoneResolver::MaxRequestsCountForIntervalForTesting(
296 TimeZoneResolver::IntervalForNextRequestForTesting( 296 TimeZoneResolver::IntervalForNextRequestForTesting(
297 requests_count))); 297 requests_count)));
298 } 298 }
299 } 299 }
300 300
301 } // namespace chromeos 301 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/timezone/timezone_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698