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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 header_value == expect_if_modified_since_; | 493 header_value == expect_if_modified_since_; |
494 | 494 |
495 saw_if_none_match_ = | 495 saw_if_none_match_ = |
496 extra_headers.GetHeader( | 496 extra_headers.GetHeader( |
497 net::HttpRequestHeaders::kIfNoneMatch, &header_value) && | 497 net::HttpRequestHeaders::kIfNoneMatch, &header_value) && |
498 header_value == expect_if_none_match_; | 498 header_value == expect_if_none_match_; |
499 } | 499 } |
500 return MockHttpServer::JobFactory(request); | 500 return MockHttpServer::JobFactory(request); |
501 } | 501 } |
502 | 502 |
| 503 protected: |
| 504 virtual ~HttpHeadersRequestTestJob() {} |
| 505 |
503 private: | 506 private: |
504 static std::string expect_if_modified_since_; | 507 static std::string expect_if_modified_since_; |
505 static bool saw_if_modified_since_; | 508 static bool saw_if_modified_since_; |
506 static std::string expect_if_none_match_; | 509 static std::string expect_if_none_match_; |
507 static bool saw_if_none_match_; | 510 static bool saw_if_none_match_; |
508 static bool already_checked_; | 511 static bool already_checked_; |
509 }; | 512 }; |
510 | 513 |
511 // static | 514 // static |
512 std::string HttpHeadersRequestTestJob::expect_if_modified_since_; | 515 std::string HttpHeadersRequestTestJob::expect_if_modified_since_; |
(...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3516 | 3519 |
3517 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsSuccess) { | 3520 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsSuccess) { |
3518 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsSuccessTest); | 3521 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsSuccessTest); |
3519 } | 3522 } |
3520 | 3523 |
3521 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) { | 3524 TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) { |
3522 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest); | 3525 RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest); |
3523 } | 3526 } |
3524 | 3527 |
3525 } // namespace appcache | 3528 } // namespace appcache |
OLD | NEW |