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

Unified Diff: chrome/common/random_unittest.cc

Issue 6873156: Move crypto_helpers from sync to base (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Follow bbretw review Created 9 years, 8 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 | « chrome/common/random.cc ('k') | ppapi/shared_impl/crypto_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/random_unittest.cc
diff --git a/chrome/common/random_unittest.cc b/chrome/common/random_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c1843e041c096cd511e718aa443f140b1f212a67
--- /dev/null
+++ b/chrome/common/random_unittest.cc
@@ -0,0 +1,18 @@
+// Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h"
+
+#include "chrome/common/random.h"
+
+TEST(SyncRandomTest, Generate128BitRandomBase64String) {
+ std::string random_string = Generate128BitRandomBase64String();
+ EXPECT_EQ(24U, random_string.size());
+ char accumulator = 0;
+ for (size_t i = 0; i < random_string.size(); ++i)
+ accumulator |= random_string[i];
+ // In theory this test can fail, but it won't before the universe dies of
+ // heat death.
+ EXPECT_NE(0, accumulator);
+}
« no previous file with comments | « chrome/common/random.cc ('k') | ppapi/shared_impl/crypto_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698