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

Unified Diff: base/unguessable_token_unittest.cc

Issue 2547753002: [Extensions] Extension Port Ids and Initialization 2.0 (Closed)
Patch Set: rebase + unguessable token Created 4 years 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
Index: base/unguessable_token_unittest.cc
diff --git a/base/unguessable_token_unittest.cc b/base/unguessable_token_unittest.cc
index dcc5db933e18950a2e4c3f513559c7a17b5eff41..c37dfbc33b376c36d5562d8b9b0f92dc9cc64056 100644
--- a/base/unguessable_token_unittest.cc
+++ b/base/unguessable_token_unittest.cc
@@ -116,4 +116,10 @@ TEST(UnguessableTokenTest, VerifyBasicUniqueness) {
UnguessableToken token = UnguessableToken::Create();
EXPECT_NE(token.GetHighForSerialization(), token.GetLowForSerialization());
}
+
+TEST(UnguessableTokenTest, UberUniqueness) {
+ std::set<UnguessableToken> tokens;
+ for (int i = 0; i < 1000000; ++i)
+ ASSERT_TRUE(tokens.insert(UnguessableToken::Create()).second);
dcheng 2016/12/03 00:50:56 How long does this take to run? Honestly, this fee
Devlin 2016/12/03 01:46:12 Whoops! This wasn't actually supposed to be inclu
+}
dcheng 2016/12/03 00:50:56 Nit: newline after this
}

Powered by Google App Engine
This is Rietveld 408576698