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

Unified Diff: chrome/browser/metrics/rappord_unittest.cc

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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
Index: chrome/browser/metrics/rappord_unittest.cc
diff --git a/chrome/browser/metrics/rappord_unittest.cc b/chrome/browser/metrics/rappord_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c189c2d6da45b2afd3ff84036cc0c034821f5cd5
--- /dev/null
+++ b/chrome/browser/metrics/rappord_unittest.cc
@@ -0,0 +1,21 @@
+// Copyright (c) 2012 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 <string>
+
+#include "chrome/browser/metrics/rappord.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+// Validate that we generate some bits for a string.
+TEST(RappordTest, GetBits) {
+ typedef RappordBloomFilter<128, 4, -4, 2, -4> rappord_t;
+
+ rappord_t rappord(10, "MySecretClientId");
+ rappord_t::bitmap_t bits = rappord.get("MyString");
+ EXPECT_EQ((long unsigned int)128, bits.to_string().length());
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698