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

Unified Diff: components/suggestions/suggestions_service_impl_unittest.cc

Issue 2872573002: Use |min| param to query a variable number of suggestions (Closed)
Patch Set: Remove unnecessary includes Created 3 years, 7 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: components/suggestions/suggestions_service_impl_unittest.cc
diff --git a/components/suggestions/suggestions_service_impl_unittest.cc b/components/suggestions/suggestions_service_impl_unittest.cc
index 217303e8ba6cdf09c6a4d9bc349a2232ac95c018..04c9c5281b76ab051cddf80538b877f78871d7de 100644
--- a/components/suggestions/suggestions_service_impl_unittest.cc
+++ b/components/suggestions/suggestions_service_impl_unittest.cc
@@ -14,11 +14,13 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
+#include "base/test/scoped_feature_list.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/fake_profile_oauth2_token_service.h"
#include "components/signin/core/browser/fake_signin_manager.h"
#include "components/signin/core/browser/test_signin_client.h"
#include "components/suggestions/blacklist_store.h"
+#include "components/suggestions/features.h"
#include "components/suggestions/image_manager.h"
#include "components/suggestions/proto/suggestions.pb.h"
#include "components/suggestions/suggestions_store.h"
@@ -26,6 +28,7 @@
#include "components/sync/driver/sync_service.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "net/base/escape.h"
+#include "net/base/url_util.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
@@ -339,6 +342,14 @@ TEST_F(SuggestionsServiceTest, FetchSuggestionsData) {
EXPECT_EQ(kTestFaviconUrl, suggestions_profile.suggestions(0).favicon_url());
}
+TEST_F(SuggestionsServiceTest, BuildUrlWithAllParameterForFewFeature) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(kUseSuggestionsEvenIfFewFeature);
+ std::string unused_value;
+ EXPECT_TRUE(net::GetValueForKeyInQuery(
+ SuggestionsServiceImpl::BuildSuggestionsURL(), "all", &unused_value));
+}
+
TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncNotInitializedEnabled) {
std::unique_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());

Powered by Google App Engine
This is Rietveld 408576698