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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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
Index: chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc b/chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc
index 59632f0ad2058ac9bf1b46576d56624bdc09a141..e6493f199538811183357f826fe75f6393c03c10 100644
--- a/chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc
@@ -9,6 +9,7 @@
#include "base/metrics/statistics_recorder.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/ntp_logging_events.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -36,7 +37,11 @@ base::HistogramBase::Count GetBinCount(const std::string& histogram_name,
} // namespace
-TEST(NTPUserDataLoggerTest, TestLogging) {
+class NTPUserDataLoggerTest : public testing::Test {
+ content::TestBrowserThreadBundle thread_bundle_;
+};
+
+TEST_F(NTPUserDataLoggerTest, TestLogging) {
base::StatisticsRecorder::Initialize();
// Ensure empty statistics.
@@ -101,7 +106,7 @@ TEST(NTPUserDataLoggerTest, TestLogging) {
EXPECT_EQ(1, GetTotalCount("NewTabPage.SuggestionsType"));
}
-TEST(NTPUserDataLoggerTest, TestLogMostVisitedImpression) {
+TEST_F(NTPUserDataLoggerTest, TestLogMostVisitedImpression) {
base::StatisticsRecorder::Initialize();
EXPECT_EQ(0, GetBinCount("NewTabPage.SuggestionsImpression.foobar", 1));
@@ -127,7 +132,7 @@ TEST(NTPUserDataLoggerTest, TestLogMostVisitedImpression) {
EXPECT_EQ(1, GetBinCount("NewTabPage.SuggestionsImpression.foobar", 5));
}
-TEST(NTPUserDataLoggerTest, TestLogMostVisitedNavigation) {
+TEST_F(NTPUserDataLoggerTest, TestLogMostVisitedNavigation) {
base::StatisticsRecorder::Initialize();
EXPECT_EQ(0, GetTotalCount("NewTabPage.MostVisited"));

Powered by Google App Engine
This is Rietveld 408576698