Commit a35284ef authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Chromium LUCI CQ

assistant: remove response process v2 flags

Clean up launched feature flag.

Bug: None
Change-Id: I205696223fd6db4136220f145c5237273df07037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2590709Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837737}
parent 163abd6c
...@@ -130,15 +130,8 @@ class AssistantInteractionControllerImpl ...@@ -130,15 +130,8 @@ class AssistantInteractionControllerImpl
private: private:
void OnTabletModeChanged(); void OnTabletModeChanged();
bool HasUnprocessedPendingResponse();
bool HasActiveInteraction() const; bool HasActiveInteraction() const;
void OnProcessPendingResponse();
void OnPendingResponseProcessed(bool is_completed);
void OnUiVisible(AssistantEntryPoint entry_point); void OnUiVisible(AssistantEntryPoint entry_point);
void StartScreenContextInteraction(bool include_assistant_structure, void StartScreenContextInteraction(bool include_assistant_structure,
const gfx::Rect& region, const gfx::Rect& region,
AssistantQuerySource query_source); AssistantQuerySource query_source);
......
...@@ -73,19 +73,9 @@ class AssistantInteractionSubscriberMock ...@@ -73,19 +73,9 @@ class AssistantInteractionSubscriberMock
// AssistantInteractionControllerImplTest -------------------------------------- // AssistantInteractionControllerImplTest --------------------------------------
class AssistantInteractionControllerImplTest class AssistantInteractionControllerImplTest : public AssistantAshTestBase {
: public AssistantAshTestBase,
public testing::WithParamInterface<bool> {
public: public:
AssistantInteractionControllerImplTest() { AssistantInteractionControllerImplTest() = default;
if (GetParam()) {
feature_list_.InitAndEnableFeature(
chromeos::assistant::features::kAssistantResponseProcessingV2);
} else {
feature_list_.InitAndDisableFeature(
chromeos::assistant::features::kAssistantResponseProcessingV2);
}
}
AssistantInteractionControllerImpl* interaction_controller() { AssistantInteractionControllerImpl* interaction_controller() {
return static_cast<AssistantInteractionControllerImpl*>( return static_cast<AssistantInteractionControllerImpl*>(
...@@ -111,14 +101,11 @@ class AssistantInteractionControllerImplTest ...@@ -111,14 +101,11 @@ class AssistantInteractionControllerImplTest
result.localized_app_name = app_name; result.localized_app_name = app_name;
return result; return result;
} }
private:
base::test::ScopedFeatureList feature_list_;
}; };
} // namespace } // namespace
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldBecomeActiveWhenInteractionStarts) { ShouldBecomeActiveWhenInteractionStarts) {
EXPECT_EQ(interaction_model()->interaction_state(), EXPECT_EQ(interaction_model()->interaction_state(),
InteractionState::kInactive); InteractionState::kInactive);
...@@ -130,7 +117,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -130,7 +117,7 @@ TEST_P(AssistantInteractionControllerImplTest,
InteractionState::kActive); InteractionState::kActive);
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldReturnErrorWhenOpenAppIsCalledWhileInactive) { ShouldReturnErrorWhenOpenAppIsCalledWhileInactive) {
EXPECT_EQ(interaction_model()->interaction_state(), EXPECT_EQ(interaction_model()->interaction_state(),
InteractionState::kInactive); InteractionState::kInactive);
...@@ -140,7 +127,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -140,7 +127,7 @@ TEST_P(AssistantInteractionControllerImplTest,
EXPECT_EQ(result, kErrorResult); EXPECT_EQ(result, kErrorResult);
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldReturnErrorWhenOpenAppIsCalledWithoutAnAndroidIntentHelper) { ShouldReturnErrorWhenOpenAppIsCalledWithoutAnAndroidIntentHelper) {
StartInteraction(); StartInteraction();
...@@ -149,7 +136,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -149,7 +136,7 @@ TEST_P(AssistantInteractionControllerImplTest,
EXPECT_EQ(result, kErrorResult); EXPECT_EQ(result, kErrorResult);
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldReturnErrorWhenOpenAppIsCalledForUnknownAndroidApp) { ShouldReturnErrorWhenOpenAppIsCalledForUnknownAndroidApp) {
StartInteraction(); StartInteraction();
FakeAndroidIntentHelper fake_helper; FakeAndroidIntentHelper fake_helper;
...@@ -157,7 +144,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -157,7 +144,7 @@ TEST_P(AssistantInteractionControllerImplTest,
CreateAndroidAppInfo("unknown-app-name"))); CreateAndroidAppInfo("unknown-app-name")));
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldLaunchAppAndReturnSuccessWhenOpenAppIsCalled) { ShouldLaunchAppAndReturnSuccessWhenOpenAppIsCalled) {
const std::string app_name = "AppName"; const std::string app_name = "AppName";
const std::string intent = "intent://AppName"; const std::string intent = "intent://AppName";
...@@ -172,7 +159,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -172,7 +159,7 @@ TEST_P(AssistantInteractionControllerImplTest,
EXPECT_EQ(intent, fake_helper.last_launched_android_intent()); EXPECT_EQ(intent, fake_helper.last_launched_android_intent());
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldAddSchemeToIntentWhenLaunchingAndroidApp) { ShouldAddSchemeToIntentWhenLaunchingAndroidApp) {
const std::string app_name = "AppName"; const std::string app_name = "AppName";
const std::string intent = "#Intent-without-a-scheme"; const std::string intent = "#Intent-without-a-scheme";
...@@ -188,7 +175,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -188,7 +175,7 @@ TEST_P(AssistantInteractionControllerImplTest,
EXPECT_EQ(intent_with_scheme, fake_helper.last_launched_android_intent()); EXPECT_EQ(intent_with_scheme, fake_helper.last_launched_android_intent());
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldCorrectlyMapSuggestionTypeToQuerySource) { ShouldCorrectlyMapSuggestionTypeToQuerySource) {
// Mock Assistant interaction subscriber. // Mock Assistant interaction subscriber.
StrictMock<AssistantInteractionSubscriberMock> mock(assistant_service()); StrictMock<AssistantInteractionSubscriberMock> mock(assistant_service());
...@@ -226,7 +213,7 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -226,7 +213,7 @@ TEST_P(AssistantInteractionControllerImplTest,
} }
} }
TEST_P(AssistantInteractionControllerImplTest, ShouldDisplayGenericErrorOnce) { TEST_F(AssistantInteractionControllerImplTest, ShouldDisplayGenericErrorOnce) {
StartInteraction(); StartInteraction();
// Call OnTtsStarted twice to mimic the behavior of libassistant when network // Call OnTtsStarted twice to mimic the behavior of libassistant when network
...@@ -253,7 +240,7 @@ TEST_P(AssistantInteractionControllerImplTest, ShouldDisplayGenericErrorOnce) { ...@@ -253,7 +240,7 @@ TEST_P(AssistantInteractionControllerImplTest, ShouldDisplayGenericErrorOnce) {
EXPECT_EQ(ui_elements.front()->type(), AssistantUiElementType::kError); EXPECT_EQ(ui_elements.front()->type(), AssistantUiElementType::kError);
} }
TEST_P(AssistantInteractionControllerImplTest, TEST_F(AssistantInteractionControllerImplTest,
ShouldUpdateTimeOfLastInteraction) { ShouldUpdateTimeOfLastInteraction) {
MockAssistantInteractionSubscriber mock_subscriber; MockAssistantInteractionSubscriber mock_subscriber;
ScopedAssistantInteractionSubscriber scoped_subscriber{&mock_subscriber}; ScopedAssistantInteractionSubscriber scoped_subscriber{&mock_subscriber};
...@@ -276,10 +263,4 @@ TEST_P(AssistantInteractionControllerImplTest, ...@@ -276,10 +263,4 @@ TEST_P(AssistantInteractionControllerImplTest,
EXPECT_NEAR(actual.InSeconds(), expected.InSeconds(), 1); EXPECT_NEAR(actual.InSeconds(), expected.InSeconds(), 1);
} }
// We parameterize all AssistantInteractionControllerImplTests to verify that
// they work for both response processing v1 as well as response processing v2.
INSTANTIATE_TEST_SUITE_P(All,
AssistantInteractionControllerImplTest,
testing::Bool());
} // namespace ash } // namespace ash
...@@ -124,13 +124,6 @@ void AssistantResponse::RemoveObserver( ...@@ -124,13 +124,6 @@ void AssistantResponse::RemoveObserver(
void AssistantResponse::AddUiElement( void AssistantResponse::AddUiElement(
std::unique_ptr<AssistantUiElement> ui_element) { std::unique_ptr<AssistantUiElement> ui_element) {
// In processing v1, UI elements are immediately added to the response.
if (!chromeos::assistant::features::IsResponseProcessingV2Enabled()) {
ui_elements_.push_back(std::move(ui_element));
NotifyUiElementAdded(ui_elements_.back().get());
return;
}
// In processing v2, UI elements are first cached in a pending state... // In processing v2, UI elements are first cached in a pending state...
auto pending_ui_element = std::make_unique<PendingUiElement>(); auto pending_ui_element = std::make_unique<PendingUiElement>();
pending_ui_element->ui_element = std::move(ui_element); pending_ui_element->ui_element = std::move(ui_element);
......
...@@ -18,12 +18,6 @@ ...@@ -18,12 +18,6 @@
namespace ash { namespace ash {
namespace {
using chromeos::assistant::features::IsResponseProcessingV2Enabled;
} // namespace
// AnimatedContainerView::ScopedDisablePreferredSizeChanged -------------------- // AnimatedContainerView::ScopedDisablePreferredSizeChanged --------------------
class AnimatedContainerView::ScopedDisablePreferredSizeChanged { class AnimatedContainerView::ScopedDisablePreferredSizeChanged {
...@@ -53,7 +47,7 @@ AnimatedContainerView::AnimatedContainerView(AssistantViewDelegate* delegate) ...@@ -53,7 +47,7 @@ AnimatedContainerView::AnimatedContainerView(AssistantViewDelegate* delegate)
} }
AnimatedContainerView::~AnimatedContainerView() { AnimatedContainerView::~AnimatedContainerView() {
if (IsResponseProcessingV2Enabled() && response_) if (response_)
response_.get()->RemoveObserver(this); response_.get()->RemoveObserver(this);
if (AssistantInteractionController::Get()) if (AssistantInteractionController::Get())
...@@ -120,7 +114,7 @@ void AnimatedContainerView::OnSuggestionsAdded( ...@@ -120,7 +114,7 @@ void AnimatedContainerView::OnSuggestionsAdded(
} }
void AnimatedContainerView::RemoveAllViews() { void AnimatedContainerView::RemoveAllViews() {
if (IsResponseProcessingV2Enabled() && response_) if (response_)
response_.get()->RemoveObserver(this); response_.get()->RemoveObserver(this);
// We explicitly abort all in progress animations here because we will remove // We explicitly abort all in progress animations here because we will remove
...@@ -170,7 +164,7 @@ std::unique_ptr<ElementAnimator> AnimatedContainerView::HandleSuggestion( ...@@ -170,7 +164,7 @@ std::unique_ptr<ElementAnimator> AnimatedContainerView::HandleSuggestion(
void AnimatedContainerView::ChangeResponse( void AnimatedContainerView::ChangeResponse(
const scoped_refptr<const AssistantResponse>& response) { const scoped_refptr<const AssistantResponse>& response) {
if (IsResponseProcessingV2Enabled() && response_) if (response_)
response_.get()->RemoveObserver(this); response_.get()->RemoveObserver(this);
// We may have to postpone the response while we animate the previous response // We may have to postpone the response while we animate the previous response
...@@ -210,13 +204,6 @@ void AnimatedContainerView::ChangeResponse( ...@@ -210,13 +204,6 @@ void AnimatedContainerView::ChangeResponse(
void AnimatedContainerView::AddResponse( void AnimatedContainerView::AddResponse(
scoped_refptr<const AssistantResponse> response) { scoped_refptr<const AssistantResponse> response) {
if (!IsResponseProcessingV2Enabled()) {
// The response should be fully processed before it is presented.
// Note that ProcessingState is only used in v1 of response processing.
DCHECK_EQ(AssistantResponse::ProcessingState::kProcessed,
response->processing_state());
}
// All children should be animated out and removed before the new response is // All children should be animated out and removed before the new response is
// added. // added.
DCHECK(content_view()->children().empty()); DCHECK(content_view()->children().empty());
...@@ -225,11 +212,9 @@ void AnimatedContainerView::AddResponse( ...@@ -225,11 +212,9 @@ void AnimatedContainerView::AddResponse(
// destroyed before we have removed associated views from the view hierarchy. // destroyed before we have removed associated views from the view hierarchy.
response_ = std::move(response); response_ = std::move(response);
if (IsResponseProcessingV2Enabled()) { // In response processing v2, we observe the |response_| so that we handle
// In response processing v2, we observe the |response_| so that we handle // new suggestions and UI elements that continue to stream in.
// new suggestions and UI elements that continue to stream in. response_.get()->AddObserver(this);
response_.get()->AddObserver(this);
}
// We can prevent over-propagation of the PreferredSizeChanged event by // We can prevent over-propagation of the PreferredSizeChanged event by
// stopping propagation during batched view hierarchy add/remove operations. // stopping propagation during batched view hierarchy add/remove operations.
......
...@@ -44,10 +44,8 @@ void FillServerExperimentIds(std::vector<std::string>* server_experiment_ids) { ...@@ -44,10 +44,8 @@ void FillServerExperimentIds(std::vector<std::string>* server_experiment_ids) {
if (base::FeatureList::IsEnabled(features::kAssistantAppSupport)) if (base::FeatureList::IsEnabled(features::kAssistantAppSupport))
server_experiment_ids->emplace_back(kServersideOpenAppExperimentId); server_experiment_ids->emplace_back(kServersideOpenAppExperimentId);
if (features::IsResponseProcessingV2Enabled()) { server_experiment_ids->emplace_back(
server_experiment_ids->emplace_back( kServersideResponseProcessingV2ExperimentId);
kServersideResponseProcessingV2ExperimentId);
}
} }
void SetServerExperiments( void SetServerExperiments(
......
...@@ -29,9 +29,6 @@ const base::Feature kAssistantDebugging{"AssistantDebugging", ...@@ -29,9 +29,6 @@ const base::Feature kAssistantDebugging{"AssistantDebugging",
const base::Feature kAssistantLauncherChipIntegration{ const base::Feature kAssistantLauncherChipIntegration{
"AssistantLauncherChipIntegration", base::FEATURE_DISABLED_BY_DEFAULT}; "AssistantLauncherChipIntegration", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAssistantResponseProcessingV2{
"AssistantResponseProcessingV2", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kAssistantRoutines{"AssistantRoutines", const base::Feature kAssistantRoutines{"AssistantRoutines",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
...@@ -124,10 +121,6 @@ bool IsLibAssistantBetaBackendEnabled() { ...@@ -124,10 +121,6 @@ bool IsLibAssistantBetaBackendEnabled() {
return base::FeatureList::IsEnabled(kEnableLibAssistantBetaBackend); return base::FeatureList::IsEnabled(kEnableLibAssistantBetaBackend);
} }
bool IsResponseProcessingV2Enabled() {
return base::FeatureList::IsEnabled(kAssistantResponseProcessingV2);
}
bool IsRoutinesEnabled() { bool IsRoutinesEnabled() {
return base::FeatureList::IsEnabled(kAssistantRoutines); return base::FeatureList::IsEnabled(kAssistantRoutines);
} }
...@@ -147,9 +140,7 @@ bool IsVoiceMatchDisabled() { ...@@ -147,9 +140,7 @@ bool IsVoiceMatchDisabled() {
} }
bool IsWaitSchedulingEnabled() { bool IsWaitSchedulingEnabled() {
// Wait scheduling is only supported for response processing v2 and routines. return base::FeatureList::IsEnabled(kAssistantWaitScheduling);
return base::FeatureList::IsEnabled(kAssistantWaitScheduling) &&
(IsResponseProcessingV2Enabled() || IsRoutinesEnabled());
} }
} // namespace features } // namespace features
......
...@@ -32,12 +32,6 @@ extern const base::Feature kAssistantBetterOnboarding; ...@@ -32,12 +32,6 @@ extern const base::Feature kAssistantBetterOnboarding;
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)
extern const base::Feature kAssistantLauncherChipIntegration; extern const base::Feature kAssistantLauncherChipIntegration;
// When enabled, Assistant will use response processing V2. This is a set of
// synced client and server changes which will turn on default parallel client
// op processing and eager (streaming) UI element rendering.
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)
extern const base::Feature kAssistantResponseProcessingV2;
// Enables Assistant routines. // Enables Assistant routines.
COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC) COMPONENT_EXPORT(ASSISTANT_SERVICE_PUBLIC)
extern const base::Feature kAssistantRoutines; extern const base::Feature kAssistantRoutines;
......
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