| OLD | NEW |
| 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 "components/captive_portal/captive_portal_detector.h" | 5 #include "components/captive_portal/captive_portal_detector.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 class CaptivePortalDetectorTest : public testing::Test, | 51 class CaptivePortalDetectorTest : public testing::Test, |
| 52 public CaptivePortalDetectorTestBase { | 52 public CaptivePortalDetectorTestBase { |
| 53 public: | 53 public: |
| 54 CaptivePortalDetectorTest() {} | 54 CaptivePortalDetectorTest() {} |
| 55 virtual ~CaptivePortalDetectorTest() {} | 55 virtual ~CaptivePortalDetectorTest() {} |
| 56 | 56 |
| 57 virtual void SetUp() OVERRIDE { | 57 virtual void SetUp() OVERRIDE { |
| 58 CHECK(base::MessageLoopProxy::current()); | 58 CHECK(base::MessageLoopProxy::current().get()); |
| 59 scoped_refptr<net::URLRequestContextGetter> request_context_getter( | 59 scoped_refptr<net::URLRequestContextGetter> request_context_getter( |
| 60 new net::TestURLRequestContextGetter( | 60 new net::TestURLRequestContextGetter( |
| 61 base::MessageLoopProxy::current())); | 61 base::MessageLoopProxy::current())); |
| 62 | 62 |
| 63 detector_.reset(new CaptivePortalDetector(request_context_getter.get())); | 63 detector_.reset(new CaptivePortalDetector(request_context_getter.get())); |
| 64 set_detector(detector_.get()); | 64 set_detector(detector_.get()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual void TearDown() OVERRIDE { | 67 virtual void TearDown() OVERRIDE { |
| 68 detector_.reset(); | 68 detector_.reset(); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 TEST_F(CaptivePortalDetectorTest, Cancel) { | 206 TEST_F(CaptivePortalDetectorTest, Cancel) { |
| 207 RunCancelTest(); | 207 RunCancelTest(); |
| 208 CaptivePortalDetector::Results results; | 208 CaptivePortalDetector::Results results; |
| 209 results.result = captive_portal::RESULT_INTERNET_CONNECTED; | 209 results.result = captive_portal::RESULT_INTERNET_CONNECTED; |
| 210 results.response_code = 204; | 210 results.response_code = 204; |
| 211 RunTest(results, net::OK, 204, NULL); | 211 RunTest(results, net::OK, 204, NULL); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace captive_portal | 214 } // namespace captive_portal |
| OLD | NEW |