| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 507 } |
| 508 }; | 508 }; |
| 509 | 509 |
| 510 class IOThread : public base::Thread { | 510 class IOThread : public base::Thread { |
| 511 public: | 511 public: |
| 512 explicit IOThread(const char* name) | 512 explicit IOThread(const char* name) |
| 513 : base::Thread(name) { | 513 : base::Thread(name) { |
| 514 } | 514 } |
| 515 | 515 |
| 516 ~IOThread() { | 516 ~IOThread() { |
| 517 // We cannot rely on our base class to stop the thread since we want our | |
| 518 // CleanUp function to run. | |
| 519 Stop(); | 517 Stop(); |
| 520 } | 518 } |
| 521 | 519 |
| 522 const scoped_refptr<net::URLRequestContext>& request_context() { | 520 const scoped_refptr<net::URLRequestContext>& request_context() { |
| 523 return request_context_; | 521 return request_context_; |
| 524 } | 522 } |
| 525 | 523 |
| 526 void SetNewJobFactory(net::URLRequestJobFactory* job_factory) { | 524 void SetNewJobFactory(net::URLRequestJobFactory* job_factory) { |
| 527 DCHECK(job_factory); | 525 DCHECK(job_factory); |
| 528 job_factory_.reset(job_factory); | 526 job_factory_.reset(job_factory); |
| (...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3450 | 3448 |
| 3451 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) { | 3449 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) { |
| 3452 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest); | 3450 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest); |
| 3453 } | 3451 } |
| 3454 | 3452 |
| 3455 } // namespace appcache | 3453 } // namespace appcache |
| 3456 | 3454 |
| 3457 // AppCacheUpdateJobTest is expected to always live longer than the | 3455 // AppCacheUpdateJobTest is expected to always live longer than the |
| 3458 // runnable methods. This lets us call NewRunnableMethod on its instances. | 3456 // runnable methods. This lets us call NewRunnableMethod on its instances. |
| 3459 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheUpdateJobTest); | 3457 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheUpdateJobTest); |
| OLD | NEW |