| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "net/cert/internal/parse_ocsp.h" | 5 #include "net/cert/internal/parse_ocsp.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/cert/internal/test_helpers.h" | 9 #include "net/cert/internal/test_helpers.h" |
| 10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 TEST(OCSPDateTest, VerifyTimeMinusAgeFromBeforeWindowsEpoch) { | 299 TEST(OCSPDateTest, VerifyTimeMinusAgeFromBeforeWindowsEpoch) { |
| 300 OCSPSingleResponse response; | 300 OCSPSingleResponse response; |
| 301 base::Time windows_epoch; | 301 base::Time windows_epoch; |
| 302 base::Time verify_time = windows_epoch + base::TimeDelta::FromDays(1); | 302 base::Time verify_time = windows_epoch + base::TimeDelta::FromDays(1); |
| 303 | 303 |
| 304 base::Time this_update = windows_epoch; | 304 base::Time this_update = windows_epoch; |
| 305 ASSERT_TRUE( | 305 ASSERT_TRUE( |
| 306 der::EncodeTimeAsGeneralizedTime(this_update, &response.this_update)); | 306 der::EncodeTimeAsGeneralizedTime(this_update, &response.this_update)); |
| 307 response.has_next_update = false; | 307 response.has_next_update = false; |
| 308 #ifdef OS_WIN | 308 #if defined(OS_WIN) |
| 309 EXPECT_FALSE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); | 309 EXPECT_FALSE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); |
| 310 #else | 310 #else |
| 311 EXPECT_TRUE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); | 311 EXPECT_TRUE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); |
| 312 #endif | 312 #endif |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace net | 315 } // namespace net |
| OLD | NEW |