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

Unified Diff: net/cert/ct_known_logs_unittest.cc

Issue 2015493002: Mark the Izenpe log as Disqualified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback Created 4 years, 7 months 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 | « net/cert/ct_known_logs_static-inc.h ('k') | net/net.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_known_logs_unittest.cc
diff --git a/net/cert/ct_known_logs_unittest.cc b/net/cert/ct_known_logs_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f5e937a66faa8a403e6a6c01f2b96abf75c36568
--- /dev/null
+++ b/net/cert/ct_known_logs_unittest.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <algorithm>
+
+#include "base/time/time.h"
+#include "crypto/sha2.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+
+namespace {
+
+#include "net/cert/ct_known_logs_static-inc.h"
+
+} // namespace
+
+TEST(CTKnownLogsTest, GoogleIDsAreSorted) {
+ ASSERT_TRUE(std::is_sorted(std::begin(kGoogleLogIDs), std::end(kGoogleLogIDs),
+ [](const char* a, const char* b) {
+ return memcmp(a, b, crypto::kSHA256Length) < 0;
+ }));
+}
+
+TEST(CTKnownLogsTest, DisallowedLogsAreSortedByLogID) {
+ ASSERT_TRUE(std::is_sorted(
+ std::begin(kDisqualifiedCTLogList), std::end(kDisqualifiedCTLogList),
+ [](const DisqualifiedCTLogInfo& a, const DisqualifiedCTLogInfo& b) {
+ return memcmp(a.log_id, b.log_id, crypto::kSHA256Length) < 0;
+ }));
+}
+
+} // namespace net
« no previous file with comments | « net/cert/ct_known_logs_static-inc.h ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698