Skip to content

Commit

Permalink
Prepare for QsRevamp remaining clean up
Browse files Browse the repository at this point in the history
This cl removes the QsRevamp==disabled use from all the unit tests.
And the QsRevamp flag is marked as forced enabled. So our users will
not see any QsRevamp disabled ui and there's no way for them to force
disable it.

This will allow us to have time to clean up the remaining QsRevamp
related code across branches (M120, M121).

Bug: b/305075031
Change-Id: I2d7140c0c72369e710c0786f184db2d5e9ccaef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4980951
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Jiaming Cheng <jiamingc@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1216442}
  • Loading branch information
jiajiabingcheng authored and Chromium LUCI CQ committed Oct 27, 2023
1 parent 42e3c50 commit e46b5b8
Show file tree
Hide file tree
Showing 44 changed files with 93 additions and 1,139 deletions.
3 changes: 0 additions & 3 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3429,7 +3429,6 @@ test("ash_unittests") {
"system/bluetooth/bluetooth_device_list_item_multiple_battery_view_unittest.cc",
"system/bluetooth/bluetooth_device_list_item_view_unittest.cc",
"system/bluetooth/bluetooth_device_status_ui_handler_unittest.cc",
"system/bluetooth/bluetooth_disabled_detailed_view_unittest.cc",
"system/bluetooth/bluetooth_feature_pod_controller_unittest.cc",
"system/bluetooth/bluetooth_notification_controller_unittest.cc",
"system/bluetooth/bluetooth_state_cache_unittest.cc",
Expand Down Expand Up @@ -3669,7 +3668,6 @@ test("ash_unittests") {
"system/unified/screen_capture_tray_item_view_unittest.cc",
"system/unified/tasks_bubble_view_unittest.cc",
"system/unified/tasks_combobox_model_unittest.cc",
"system/unified/top_shortcuts_view_unittest.cc",
"system/unified/unified_system_info_view_unittest.cc",
"system/unified/unified_system_tray_controller_unittest.cc",
"system/unified/unified_system_tray_unittest.cc",
Expand Down Expand Up @@ -4096,7 +4094,6 @@ test("ash_pixeltests") {
"system/unified/power_button_pixeltest.cc",
"system/unified/quick_settings_footer_pixeltest.cc",
"system/unified/unified_slider_view_pixeltest.cc",
"system/unified/unified_system_tray_pixeltest.cc",
"system/update/eol_notice_quick_settings_view_pixeltest.cc",
"system/video_conference/bubble/bubble_view_pixeltest.cc",
"system/video_conference/video_conference_tray_pixeltest.cc",
Expand Down
4 changes: 2 additions & 2 deletions ash/app_list/views/app_list_bubble_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1646,8 +1646,8 @@ class AppListBubbleViewWithQsRevampTest
->IsBubbleShown()
: GetPrimaryUnifiedSystemTray()->IsMessageCenterBubbleShown();
}

bool IsQsRevampEnabled() { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

private:
base::test::ScopedFeatureList scoped_feature_list_;
Expand Down
3 changes: 2 additions & 1 deletion ash/capture_mode/capture_mode_camera_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4736,7 +4736,8 @@ class CaptureModePrivacyIndicatorsTest
->privacy_indicators_view();
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }

private:
base::test::ScopedFeatureList scoped_feature_list_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class CaptureModeFeaturePodControllerTest
}
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }

// AshTestBase:
void SetUp() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ TEST_F(ArcChromeFeatureFlagsBridgeTest, NotifyQsRevamp_Enabled) {
EXPECT_TRUE(instance()->flags_called_value()->qs_revamp);
}

TEST_F(ArcChromeFeatureFlagsBridgeTest, NotifyQsRevamp_Disabled) {
scoped_feature_list()->InitAndDisableFeature(ash::features::kQsRevamp);
Connect();
EXPECT_FALSE(instance()->flags_called_value()->qs_revamp);
}

TEST_F(ArcChromeFeatureFlagsBridgeTest, NotifyJelly_Enabled) {
scoped_feature_list()->InitAndEnableFeature(chromeos::features::kJelly);
Connect();
Expand Down
2 changes: 1 addition & 1 deletion ash/constants/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3993,7 +3993,7 @@ bool IsProjectorUpdateIndexableTextEnabled() {
// TODO(b/305075031): Remove `kQsRevamp` and this method after all the clean up
// is done.
bool IsQsRevampEnabled() {
return base::FeatureList::IsEnabled(kQsRevamp);
return true;
}

bool IsProjectorAccountSwitchNotificationEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class ArcNotificationContentViewTest

~ArcNotificationContentViewTest() override = default;

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }

void SetUp() override {
AshTestBase::SetUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class AccessibilityFeaturePodControllerTest

~AccessibilityFeaturePodControllerTest() override = default;

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

void SetUp() override {
NoSessionAshTestBase::SetUp();
Expand Down
3 changes: 2 additions & 1 deletion ash/system/audio/mic_gain_slider_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class MicGainSliderControllerTest : public AshTestBase,
AshTestBase::TearDown();
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }

std::unique_ptr<views::View> GetMuteToastView() {
return mic_gain_slider_controller_.CreateView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ class BluetoothDeviceListControllerTest
->notify_device_list_changed_call_count());
}

bool IsQsRevampEnabled() { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

views::View* device_list() {
return static_cast<BluetoothDetailedView*>(
Expand Down
113 changes: 0 additions & 113 deletions ash/system/bluetooth/bluetooth_disabled_detailed_view_unittest.cc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class BluetoothFeaturePodControllerTest
}
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

// AshTestBase:
void SetUp() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class AutozoomFeaturePodControllerTest
}
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

// AshTestBase:
void TearDown() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ class ChannelIndicatorQuickSettingsViewPixelTest

// AshTestBase:
void SetUp() override {
// TODO(b/305075031) clean up after the flag is removed.
feature_list_.InitWithFeatureStates(
{{features::kQsRevamp, /*enabled=*/GetParam()},
{chromeos::features::kJelly, /*enabled=*/GetParam()}});
{{features::kQsRevamp, /*enabled=*/true},
{chromeos::features::kJelly, /*enabled=*/true}});

// Install a test delegate to allow overriding channel version.
auto delegate = std::make_unique<TestShellDelegate>();
Expand Down Expand Up @@ -78,7 +79,8 @@ class ChannelIndicatorQuickSettingsViewPixelTest
AshTestBase::TearDown();
}

bool IsQsRevampAndJellyEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampAndJellyEnabled() const { return true; }

QuickSettingsHeader* header() { return header_; }
ChannelIndicatorQuickSettingsView* view() {
Expand Down Expand Up @@ -120,7 +122,7 @@ TEST_P(ChannelIndicatorQuickSettingsViewPixelTest, FeedbackButtonVisible) {
// `ChannelIndicatorQuickSettingsView`.
EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen(
"feedback_button_visible",
/*revision_number=*/6, view()));
/*revision_number=*/7, view()));
}

} // namespace ash
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class ChannelIndicatorQuickSettingsViewTest
public testing::WithParamInterface<std::tuple<bool, bool>> {
public:
ChannelIndicatorQuickSettingsViewTest() {
// Param 0 is whether QsRevamp is enabled.
if (std::get<0>(GetParam())) {
feature_list_.InitAndEnableFeature(features::kQsRevamp);
}
// TODO(b/305075031) clean up after the flag is removed.
feature_list_.InitAndEnableFeature(features::kQsRevamp);
}
ChannelIndicatorQuickSettingsViewTest(
const ChannelIndicatorQuickSettingsViewTest&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class DarkModeFeaturePodControllerTest
: public AshTestBase,
public testing::WithParamInterface<bool> {
public:
bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

// AshTestBase:
void SetUp() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class DoNotDisturbNotificationControllerTest
AshTestBase::SetUp();
}

bool IsQsRevampEnabled() { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

private:
base::test::ScopedFeatureList scoped_feature_list_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ TEST_F(SnoopingProtectionNotificationBlockerTest,

// Test that message center is visible when click "Show" button.
TEST_F(SnoopingProtectionNotificationBlockerTest, ShowButtonClicked) {
// TODO(b/305075031) clean up after the flag is removed.
if (features::IsQsRevampEnabled()) {
return;
}
SetBlockerPref(true);

// Simulate snooper presence.
Expand Down
3 changes: 2 additions & 1 deletion ash/system/ime/ime_feature_pod_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class IMEFeaturePodControllerTest : public NoSessionAshTestBase,

~IMEFeaturePodControllerTest() override = default;

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

void SetUp() override {
NoSessionAshTestBase::SetUp();
Expand Down
3 changes: 2 additions & 1 deletion ash/system/locale/locale_feature_pod_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class LocaleFeaturePodControllerTest

~LocaleFeaturePodControllerTest() override = default;

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() { return true; }

void SetUp() override {
NoSessionAshTestBase::SetUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ class AshMessagePopupCollectionTest
}
}

bool IsQsRevampEnabled() const { return std::get<0>(GetParam()); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }
bool IsNotifierCollisionEnabled() const { return std::get<1>(GetParam()); }

protected:
Expand Down Expand Up @@ -193,10 +194,11 @@ class AshMessagePopupCollectionTest
return OUTSIDE;
}

if (center_point.x() < point.x())
if (center_point.x() < point.x()) {
return (center_point.y() < point.y()) ? BOTTOM_RIGHT : TOP_RIGHT;
else
} else {
return (center_point.y() < point.y()) ? BOTTOM_LEFT : TOP_LEFT;
}
}

gfx::Rect GetWorkArea() { return GetPrimaryPopupCollection()->work_area_; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ class NotificationGroupingControllerTest
->IsAnimating();
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }

base::test::ScopedFeatureList scoped_feature_list_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class SessionStateNotificationBlockerTest
blocker_->AddObserver(this);
}

bool IsQsRevampEnabled() const { return GetParam(); }
// TODO(b/305075031) clean up after the flag is removed.
bool IsQsRevampEnabled() const { return true; }

void TearDown() override {
blocker_->RemoveObserver(this);
Expand Down

0 comments on commit e46b5b8

Please sign in to comment.