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

Side by Side Diff: components/domain_reliability/dispatcher_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/dispatcher.h" 5 #include "components/domain_reliability/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/domain_reliability/test_util.h" 8 #include "components/domain_reliability/test_util.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace domain_reliability {
12 namespace {
13
11 using base::TimeDelta; 14 using base::TimeDelta;
12 using base::TimeTicks; 15 using base::TimeTicks;
13 16
14 namespace domain_reliability {
15
16 class DomainReliabilityDispatcherTest : public testing::Test { 17 class DomainReliabilityDispatcherTest : public testing::Test {
17 public: 18 public:
18 DomainReliabilityDispatcherTest() : dispatcher_(&time_) {} 19 DomainReliabilityDispatcherTest() : dispatcher_(&time_) {}
19 20
20 protected: 21 protected:
21 MockTime time_; 22 MockTime time_;
22 DomainReliabilityDispatcher dispatcher_; 23 DomainReliabilityDispatcher dispatcher_;
23 }; 24 };
24 25
25 TEST_F(DomainReliabilityDispatcherTest, Create) { 26 TEST_F(DomainReliabilityDispatcherTest, Create) {
(...skipping 25 matching lines...) Expand all
51 TimeDelta delay = TimeDelta::FromSeconds(1); 52 TimeDelta delay = TimeDelta::FromSeconds(1);
52 TestCallback callback; 53 TestCallback callback;
53 54
54 dispatcher_.ScheduleTask(callback.callback(), 2 * delay, 3 * delay); 55 dispatcher_.ScheduleTask(callback.callback(), 2 * delay, 3 * delay);
55 time_.Advance(2 * delay); 56 time_.Advance(2 * delay);
56 EXPECT_FALSE(callback.called()); 57 EXPECT_FALSE(callback.called());
57 time_.Advance(delay); 58 time_.Advance(delay);
58 EXPECT_TRUE(callback.called()); 59 EXPECT_TRUE(callback.called());
59 } 60 }
60 61
62 } // namespace
61 } // namespace domain_reliability 63 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/context_unittest.cc ('k') | components/domain_reliability/monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698