| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 void SetNewJobFactory(net::URLRequestJobFactory* job_factory) { | 557 void SetNewJobFactory(net::URLRequestJobFactory* job_factory) { |
| 558 DCHECK(job_factory); | 558 DCHECK(job_factory); |
| 559 job_factory_.reset(job_factory); | 559 job_factory_.reset(job_factory); |
| 560 request_context_->set_job_factory(job_factory_.get()); | 560 request_context_->set_job_factory(job_factory_.get()); |
| 561 } | 561 } |
| 562 | 562 |
| 563 virtual void Init() { | 563 virtual void Init() { |
| 564 job_factory_.reset(new net::URLRequestJobFactoryImpl); | 564 job_factory_.reset(new net::URLRequestJobFactoryImpl); |
| 565 job_factory_->SetProtocolHandler("http", new MockHttpServerJobFactory); | 565 job_factory_->SetProtocolHandler("http", new MockHttpServerJobFactory); |
| 566 job_factory_->SetProtocolHandler("https", new MockHttpServerJobFactory); | 566 job_factory_->SetProtocolHandler("https", new MockHttpServerJobFactory); |
| 567 request_context_.reset(new net::TestURLRequestContext()); | 567 request_context_.reset(new TestURLRequestContext()); |
| 568 request_context_->set_job_factory(job_factory_.get()); | 568 request_context_->set_job_factory(job_factory_.get()); |
| 569 } | 569 } |
| 570 | 570 |
| 571 virtual void CleanUp() { | 571 virtual void CleanUp() { |
| 572 request_context_.reset(); | 572 request_context_.reset(); |
| 573 job_factory_.reset(); | 573 job_factory_.reset(); |
| 574 } | 574 } |
| 575 | 575 |
| 576 private: | 576 private: |
| 577 scoped_ptr<net::URLRequestJobFactory> job_factory_; | 577 scoped_ptr<net::URLRequestJobFactory> job_factory_; |
| (...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3581 | 3581 |
| 3582 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsSuccess) { | 3582 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsSuccess) { |
| 3583 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsSuccessTest); | 3583 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsSuccessTest); |
| 3584 } | 3584 } |
| 3585 | 3585 |
| 3586 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) { | 3586 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) { |
| 3587 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest); | 3587 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest); |
| 3588 } | 3588 } |
| 3589 | 3589 |
| 3590 } // namespace appcache | 3590 } // namespace appcache |
| OLD | NEW |