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

Unified Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory_browsertest.cc

Issue 2686053002: Don't instantiate ContentSuggestionsService on non-Android (Closed)
Patch Set: Add browsertest Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_snippets/content_suggestions_service_factory_browsertest.cc
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory_browsertest.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4878af5e305610373728ec208c3f65d185704f2d
--- /dev/null
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory_browsertest.cc
@@ -0,0 +1,22 @@
+// Copyright 2017 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 "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
+
+#include "chrome/browser/ui/browser.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using ContentSuggestionsServiceFactoryTest = InProcessBrowserTest;
+
+IN_PROC_BROWSER_TEST_F(ContentSuggestionsServiceFactoryTest,
+ CreatesServiceOnlyOnAndroid) {
+ ntp_snippets::ContentSuggestionsService* service =
+ ContentSuggestionsServiceFactory::GetForProfile(browser()->profile());
+#if defined(OS_ANDROID)
+ EXPECT_TRUE(service);
+#else
+ EXPECT_FALSE(service);
+#endif
+}
« no previous file with comments | « chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698