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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_service_unittest.cc

Issue 10795038: Enable captive portal detection by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/captive_portal/captive_portal_service.h" 5 #include "chrome/browser/captive_portal/captive_portal_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } // namespace 131 } // namespace
132 132
133 class CaptivePortalServiceTest : public testing::Test { 133 class CaptivePortalServiceTest : public testing::Test {
134 public: 134 public:
135 CaptivePortalServiceTest() {} 135 CaptivePortalServiceTest() {}
136 136
137 virtual ~CaptivePortalServiceTest() {} 137 virtual ~CaptivePortalServiceTest() {}
138 138
139 void Initialize(bool enable_on_command_line) { 139 void Initialize(bool enable_on_command_line) {
140 if (enable_on_command_line) { 140 if (enable_on_command_line) {
141 CommandLine::ForCurrentProcess()->AppendSwitch( 141 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
142 switches::kCaptivePortalDetection); 142 switches::kCaptivePortalDetection,
143 switches::kCaptivePortalDetectionEnabled);
144 } else {
145 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
146 switches::kCaptivePortalDetection,
147 switches::kCaptivePortalDetectionDisabled);
143 } 148 }
144 149
145 profile_.reset(new TestingProfile()); 150 profile_.reset(new TestingProfile());
146 service_.reset(new TestCaptivePortalService(profile_.get())); 151 service_.reset(new TestCaptivePortalService(profile_.get()));
147 scoped_ptr<TestCaptivePortalService> service_; 152 scoped_ptr<TestCaptivePortalService> service_;
148 153
149 // Use no delays for most tests. 154 // Use no delays for most tests.
150 set_initial_backoff_no_portal(base::TimeDelta()); 155 set_initial_backoff_no_portal(base::TimeDelta());
151 set_initial_backoff_portal(base::TimeDelta()); 156 set_initial_backoff_portal(base::TimeDelta());
152 157
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 619
615 RunTest(RESULT_NO_RESPONSE, 620 RunTest(RESULT_NO_RESPONSE,
616 net::OK, 621 net::OK,
617 503, 622 503,
618 0, 623 0,
619 "HTTP/1.1 503 OK\nRetry-After: Christmas\n\n"); 624 "HTTP/1.1 503 OK\nRetry-After: Christmas\n\n");
620 EXPECT_EQ(base::TimeDelta::FromSeconds(100), GetTimeUntilNextRequest()); 625 EXPECT_EQ(base::TimeDelta::FromSeconds(100), GetTimeUntilNextRequest());
621 } 626 }
622 627
623 } // namespace captive_portal 628 } // namespace captive_portal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698