Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: net/cert/ct_policy_enforcer_unittest.cc

Issue 2524613002: Move the sanity check on build time vs current time to the net test (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/test/run_all_unittests.cc » ('j') | net/test/run_all_unittests.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_policy_enforcer_unittest.cc
diff --git a/net/cert/ct_policy_enforcer_unittest.cc b/net/cert/ct_policy_enforcer_unittest.cc
index faad82b58b031ec74f5e2e84cbf07a25a683f357..48301d2ba28c81698a6090c84ec5d0cd1bff8787 100644
--- a/net/cert/ct_policy_enforcer_unittest.cc
+++ b/net/cert/ct_policy_enforcer_unittest.cc
@@ -7,7 +7,6 @@
#include <memory>
#include <string>
-#include "base/build_time.h"
#include "base/time/time.h"
#include "base/version.h"
#include "crypto/rsa_private_key.h"
@@ -60,8 +59,6 @@ static_assert(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length,
class CTPolicyEnforcerTest : public ::testing::Test {
public:
void SetUp() override {
- VerifyBuildIsTimely();
-
policy_enforcer_.reset(new CTPolicyEnforcer);
std::string der_test_cert(ct::GetDerEncodedX509Cert());
@@ -134,20 +131,6 @@ class CTPolicyEnforcerTest : public ::testing::Test {
}
protected:
- void VerifyBuildIsTimely() {
- base::Time build_time = base::GetBuildTime();
- base::Time now = base::Time::Now();
-
- // Internally CTPolicyEnforcer expects the build time to be no older than 10
- // weeks. If it is then many tests in this file (and other net unittests)
- // will fail. crbug.com/666821
- EXPECT_LT((now - build_time).InDays(), 70)
- << "IMPORTANT: There is a problem with the system clock and/or the "
- "build timestamp. This will lead to many net_unittests failing "
- "(crbug.com/666821)\n"
- << "now: " << now << ", build_time: " << build_time;
- }
-
std::unique_ptr<CTPolicyEnforcer> policy_enforcer_;
scoped_refptr<X509Certificate> chain_;
std::string google_log_id_;
« no previous file with comments | « no previous file | net/test/run_all_unittests.cc » ('j') | net/test/run_all_unittests.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698