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

Unified Diff: components/rappor/rappor_utils_unittest.cc

Issue 311133006: Add more Rappor metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« components/rappor/rappor_utils.cc ('K') | « components/rappor/rappor_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/rappor/rappor_utils_unittest.cc
diff --git a/components/rappor/rappor_utils_unittest.cc b/components/rappor/rappor_utils_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ae407d7247f7f52a746805b7030efad2502e4127
--- /dev/null
+++ b/components/rappor/rappor_utils_unittest.cc
@@ -0,0 +1,26 @@
+// Copyright 2014 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 "components/rappor/rappor_utils.h"
+
+#include "components/rappor/rappor_service.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace rappor {
+
+// Make sure we don't crash with a null service.
+TEST(RapporUtilsTest, NullServiceTest) {
+ SampleDomainAndRegistryFromHost(NULL, "", "");
Peter Kasting 2014/06/06 02:05:48 Nit: Use std::string() in place of "" (many places
Steven Holte 2014/06/06 21:00:51 Done.
+ SampleDomainAndRegistryFromGURL(NULL, "", GURL());
+}
+
+// Make sure recording a sample doesn't cause a crash.
+TEST(RapporUtilsTest, SmokeTest) {
+ RapporService service;
+ SampleDomainAndRegistryFromHost(&service, "", "");
+ SampleDomainAndRegistryFromGURL(&service, "", GURL());
+}
+
+} // namespace rappor
« components/rappor/rappor_utils.cc ('K') | « components/rappor/rappor_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698