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

Side by Side Diff: components/domain_reliability/scheduler_unittest.cc

Issue 267633002: Domain Reliability: Don't send proxy address, other fixes (Closed) Base URL: http://git.chromium.org/chromium/src.git@domrel_security
Patch Set: Include https://codereview.chromium.org/271593002/ Created 6 years, 7 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 "components/domain_reliability/scheduler.h" 5 #include "components/domain_reliability/scheduler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "components/domain_reliability/config.h" 9 #include "components/domain_reliability/config.h"
10 #include "components/domain_reliability/test_util.h" 10 #include "components/domain_reliability/test_util.h"
11 #include "components/domain_reliability/util.h" 11 #include "components/domain_reliability/util.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace domain_reliability {
15 namespace {
16
14 using base::TimeDelta; 17 using base::TimeDelta;
15 using base::TimeTicks; 18 using base::TimeTicks;
16 19
17 namespace domain_reliability {
18
19 class DomainReliabilitySchedulerTest : public testing::Test { 20 class DomainReliabilitySchedulerTest : public testing::Test {
20 public: 21 public:
21 DomainReliabilitySchedulerTest() 22 DomainReliabilitySchedulerTest()
22 : num_collectors_(0), 23 : num_collectors_(0),
23 params_(CreateDefaultParams()), 24 params_(CreateDefaultParams()),
24 callback_called_(false) {} 25 callback_called_(false) {}
25 26
26 void CreateScheduler(int num_collectors) { 27 void CreateScheduler(int num_collectors) {
27 DCHECK_LT(0, num_collectors); 28 DCHECK_LT(0, num_collectors);
28 DCHECK(!scheduler_); 29 DCHECK(!scheduler_);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 scheduler_->OnUploadComplete(false); 204 scheduler_->OnUploadComplete(false);
204 205
205 ASSERT_TRUE(CheckPendingUpload(zero_delta(), max_delay() - min_delay())); 206 ASSERT_TRUE(CheckPendingUpload(zero_delta(), max_delay() - min_delay()));
206 time_.Advance(retry_interval()); 207 time_.Advance(retry_interval());
207 208
208 // T = min_delay + retry_interval; collector 0 should be active again. 209 // T = min_delay + retry_interval; collector 0 should be active again.
209 ASSERT_TRUE(CheckStartingUpload(0)); 210 ASSERT_TRUE(CheckStartingUpload(0));
210 scheduler_->OnUploadComplete(true); 211 scheduler_->OnUploadComplete(true);
211 } 212 }
212 213
214 } // namespace
213 } // namespace domain_reliability 215 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/monitor_unittest.cc ('k') | components/domain_reliability/uploader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698