Commit e5745413 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Enable ContentSuggestions by default

This CL enables the ContentSuggestions flag by default.
The rollout is currently being done using finch and will reach 100%
soon.

Bug: 764720
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I52ace8c4240275abf75b1e8b16433cbccbc78d15
Reviewed-on: https://chromium-review.googlesource.com/754840Reviewed-by: default avatarMenglu Huang <huangml@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517369}
parent 121a6e25
......@@ -10,6 +10,9 @@
namespace tests_hook {
bool DisableContentSuggestions() {
return false;
}
bool DisableContextualSearch() {
return false;
}
......
......@@ -7,6 +7,10 @@
namespace tests_hook {
// Returns true if ContentSuggestions should be disabled to allow other tests to
// run unimpeded.
bool DisableContentSuggestions();
// Returns true if contextual search should be disabled to allow other tests
// to run unimpeded.
bool DisableContextualSearch();
......
......@@ -41,7 +41,7 @@ NSString* const kClearApplicationGroup = @"ClearApplicationGroup";
const base::Feature kEnableThirdPartyKeyboardWorkaround{
"EnableThirdPartyKeyboardWorkaround", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kIOSNTPSuggestions{"IOSNTPSuggestions",
base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace
......
......@@ -21,6 +21,7 @@ source_set("ntp_snippets") {
"//components/signin/core/browser",
"//components/version_info",
"//google_apis",
"//ios/chrome/app:tests_hook",
"//ios/chrome/browser",
"//ios/chrome/browser/bookmarks",
"//ios/chrome/browser/browser_state",
......
......@@ -7,6 +7,7 @@
#include "base/memory/singleton.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/ntp_snippets/content_suggestions_service.h"
#include "ios/chrome/app/tests_hook.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h"
#include "ios/chrome/browser/history/history_service_factory.h"
......@@ -56,6 +57,10 @@ IOSChromeContentSuggestionsServiceFactory::
std::unique_ptr<KeyedService>
IOSChromeContentSuggestionsServiceFactory::BuildServiceInstanceFor(
web::BrowserState* browser_state) const {
if (tests_hook::DisableContentSuggestions()) {
return ntp_snippets::CreateChromeContentSuggestionsService(browser_state);
} else {
return ntp_snippets::CreateChromeContentSuggestionsServiceWithProviders(
browser_state);
}
}
......@@ -405,8 +405,6 @@ void SelectNewTabPagePanel(ntp_home::PanelIdentifier panel_type) {
id<GREYMatcher> locationbarButton = grey_allOf(
grey_accessibilityLabel(l10n_util::GetNSString(IDS_OMNIBOX_EMPTY_HINT)),
grey_minimumVisiblePercent(0.2), nil);
[[EarlGrey selectElementWithMatcher:locationbarButton]
assertWithMatcher:grey_text(@"Search or type URL")];
[[EarlGrey selectElementWithMatcher:locationbarButton]
performAction:grey_typeText(@"a")];
......
......@@ -10,6 +10,10 @@
namespace tests_hook {
bool DisableContentSuggestions() {
return true;
}
bool DisableContextualSearch() {
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment