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

Unified Diff: components/suggestions/suggestions_service_impl_unittest.cc

Issue 2872573002: Use |min| param to query a variable number of suggestions (Closed)
Patch Set: Control number of suggestion with variation param 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 84c28fd3d131703d27a14d486f28a67e06ef81bc..5043387d2b4132432760fc39dfd5d7658dc7e13a 100644
--- a/components/suggestions/suggestions_service_impl_unittest.cc
+++ b/components/suggestions/suggestions_service_impl_unittest.cc
@@ -14,17 +14,21 @@
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/test/mock_callback.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"
#include "components/sync/driver/fake_sync_service.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
+#include "components/variations/variations_params_manager.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"
@@ -337,6 +341,15 @@ TEST_F(SuggestionsServiceTest, DoesNotFetchOnStartup) {
base::RunLoop().RunUntilIdle();
}
+TEST_F(SuggestionsServiceTest, BuildUrlWithDefaultMinZeroParamForFewFeature) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(kUseSuggestionsEvenIfFewFeature);
+ std::string min_suggestions;
+ EXPECT_TRUE(net::GetValueForKeyInQuery(
+ SuggestionsServiceImpl::BuildSuggestionsURL(), "min", &min_suggestions));
+ EXPECT_EQ(min_suggestions, "0");
+}
+
TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncNotInitializedEnabled) {
EXPECT_CALL(mock_sync_service_, IsSyncActive()).WillRepeatedly(Return(false));
suggestions_service_->OnStateChanged(&mock_sync_service_);

Powered by Google App Engine
This is Rietveld 408576698