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 |