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 ef75e2e29faa22390c8be68c67e60be99ae75da0..150a962294814783e48c6b9b53d1177b3d917947 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" |
@@ -330,6 +333,15 @@ TEST_F(SuggestionsServiceTest, IgnoresUninterestingSyncChange) { |
EXPECT_EQ(0, suggestions_data_callback_count_); |
} |
+TEST_F(SuggestionsServiceTest, BuildUrlWithMinEqualsZeroParamForFewFeature) { |
+ 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_); |