0

snap-group: Clean up kOsSettingsRevampWayfinding

The `kOsSettingsRevampWayfinding` flag in the unit test became obsolete after the "Faster Split Screen Launch" feature flag was removed but wasn't cleaned up with the rest of the code.

Fixed: b/371221819
Test: Cleaned up tests
Change-Id: I4e3c9ff1eeb5c8d85555a841778fa730c67092bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5908630
Commit-Queue: Michele Fan <michelefan@chromium.org>
Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364464}
This commit is contained in:
Michele Fan
2024-10-04 21:46:31 +00:00
committed by Chromium LUCI CQ
parent 84c534174f
commit 4cdbb96ef9
11 changed files with 58 additions and 123 deletions

@ -70,18 +70,11 @@ void PerformMoveWindowAccel() {
class DisplayMoveWindowUtilTest : public AshTestBase {
public:
DisplayMoveWindowUtilTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
DisplayMoveWindowUtilTest() = default;
DisplayMoveWindowUtilTest(const DisplayMoveWindowUtilTest&) = delete;
DisplayMoveWindowUtilTest& operator=(const DisplayMoveWindowUtilTest&) =
delete;
~DisplayMoveWindowUtilTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
TEST_F(DisplayMoveWindowUtilTest, SingleDisplay) {

@ -135,11 +135,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
class FrameSizeButtonTest : public AshTestBase {
public:
FrameSizeButtonTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
FrameSizeButtonTest() = default;
explicit FrameSizeButtonTest(bool resizable) : resizable_(resizable) {}
FrameSizeButtonTest(const FrameSizeButtonTest&) = delete;
@ -209,8 +205,6 @@ class FrameSizeButtonTest : public AshTestBase {
TestWidgetDelegate* widget_delegate() { return widget_delegate_; }
private:
base::test::ScopedFeatureList scoped_feature_list_;
// Not owned.
raw_ptr<WindowState, DanglingUntriaged> window_state_;
raw_ptr<views::Widget, DanglingUntriaged> widget_;

@ -479,7 +479,6 @@ class DesksTest : public AshTestBase,
scoped_feature_list_.InitWithFeatureStates(
{{features::kFeatureManagement16Desks, GetParam().use_16_desks},
{features::kPerDeskShelf, GetParam().per_desk_shelf},
{features::kOsSettingsRevampWayfinding, true},
{features::kDeskBarWindowOcclusionOptimization, true},
{chromeos::features::kOverviewSessionInitOptimizations, true}});

@ -25,22 +25,7 @@ using session_manager::SessionState;
namespace ash {
class PersistentWindowControllerTest : public AshTestBase {
public:
PersistentWindowControllerTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
PersistentWindowControllerTest(const PersistentWindowControllerTest&) =
delete;
PersistentWindowControllerTest& operator=(
const PersistentWindowControllerTest&) = delete;
~PersistentWindowControllerTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
using PersistentWindowControllerTest = AshTestBase;
display::ManagedDisplayInfo CreateDisplayInfo(int64_t id,
const gfx::Rect& bounds) {

@ -40,8 +40,7 @@ class OverviewGridTest : public AshTestBase {
public:
OverviewGridTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding,
chromeos::features::
/*enabled_features=*/{chromeos::features::
kOverviewSessionInitOptimizations},
/*disabled_features=*/{features::kForestFeature});
}
@ -393,13 +392,7 @@ TEST_F(OverviewGridTest, DoesNotRecordDelayedDeskBarPresentationMetric) {
class OverviewGridForestTest : public OverviewTestBase {
public:
OverviewGridForestTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding,
features::kForestFeature,
features::kDeskBarWindowOcclusionOptimization},
/*disabled_features=*/{});
}
OverviewGridForestTest() = default;
OverviewGridForestTest(const OverviewGridForestTest&) = delete;
OverviewGridForestTest& operator=(const OverviewGridForestTest&) = delete;
~OverviewGridForestTest() override = default;
@ -448,7 +441,8 @@ class OverviewGridForestTest : public OverviewTestBase {
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
base::test::ScopedFeatureList scoped_feature_list_{
chromeos::features::kOverviewSessionInitOptimizations};
};
// Tests that with only one window, we always animate.

@ -7177,8 +7177,9 @@ class SplitViewOverviewSessionTest : public OverviewTestBase {
public:
SplitViewOverviewSessionTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding,
features::kDeskBarWindowOcclusionOptimization},
/*enabled_features=*/{features::kDeskBarWindowOcclusionOptimization,
chromeos::features::
kOverviewSessionInitOptimizations},
/*disabled_features=*/{});
}
@ -11277,7 +11278,6 @@ class OverviewWallpaperTest : public OverviewTestBase {
OverviewWallpaperTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kForestFeature,
features::kOsSettingsRevampWayfinding,
features::kDeskBarWindowOcclusionOptimization},
/*disabled_features=*/{});
}

@ -313,11 +313,7 @@ class SnapGroupTestBase : public OverviewTestBase {
class FasterSplitScreenTest : public SnapGroupTestBase {
public:
FasterSplitScreenTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
FasterSplitScreenTest() = default;
FasterSplitScreenTest(const FasterSplitScreenTest&) = delete;
FasterSplitScreenTest& operator=(const FasterSplitScreenTest&) = delete;
~FasterSplitScreenTest() override = default;
@ -330,9 +326,6 @@ class FasterSplitScreenTest : public SnapGroupTestBase {
protected:
base::HistogramTester histogram_tester_;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
// Tests the behavior in existing partial overview, i.e. overview -> drag to
@ -2112,8 +2105,7 @@ class SnapGroupTest : public SnapGroupTestBase {
: SnapGroupTestBase(std::forward<TaskEnvironmentTraits>(traits)...) {
scoped_feature_list_
.InitWithFeatures(/*enabled_features=*/
{features::kOsSettingsRevampWayfinding,
features::kSameAppWindowCycle,
{features::kSameAppWindowCycle,
chromeos::features::
kOverviewSessionInitOptimizations},
/*disabled_features=*/{});

@ -136,7 +136,7 @@ class TestBubbleDialogDelegateView : public views::BubbleDialogDelegateView {
TestBubbleDialogDelegateView& operator=(const TestBubbleDialogDelegateView&) =
delete;
~TestBubbleDialogDelegateView() override {}
~TestBubbleDialogDelegateView() override = default;
};
// Helper class to simulate the text input field in a window. When the text
@ -195,11 +195,7 @@ class TestTextInputClient : public ui::DummyTextInputClient {
class SplitViewControllerTest : public AshTestBase {
public:
SplitViewControllerTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
SplitViewControllerTest() = default;
SplitViewControllerTest(const SplitViewControllerTest&) = delete;
SplitViewControllerTest& operator=(const SplitViewControllerTest&) = delete;
~SplitViewControllerTest() override = default;
@ -340,8 +336,6 @@ class SplitViewControllerTest : public AshTestBase {
std::vector<std::string> trace_names_;
base::HistogramTester histograms_;
base::test::ScopedFeatureList scoped_feature_list_;
};
// Tests the basic functionalities.

@ -117,11 +117,7 @@ extern const size_t kAccelerometerVerticalHingeUnstableAnglesTestDataLength;
class TabletModeControllerTest : public AshTestBase {
public:
TabletModeControllerTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
TabletModeControllerTest() = default;
TabletModeControllerTest(const TabletModeControllerTest&) = delete;
TabletModeControllerTest& operator=(const TabletModeControllerTest&) = delete;
@ -251,8 +247,6 @@ class TabletModeControllerTest : public AshTestBase {
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
std::unique_ptr<TabletModeControllerTestApi> test_api_;
base::SimpleTestTickClock test_tick_clock_;

@ -71,11 +71,7 @@ class WindowRestoreControllerTest : public AshTestBase,
app_restore::WindowInfo info;
};
WindowRestoreControllerTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
WindowRestoreControllerTest() = default;
WindowRestoreControllerTest(const WindowRestoreControllerTest&) = delete;
WindowRestoreControllerTest& operator=(const WindowRestoreControllerTest&) =
delete;
@ -311,8 +307,6 @@ class WindowRestoreControllerTest : public AshTestBase,
fake_window_restore_file_[restore_window_id].info = window_info;
}
base::test::ScopedFeatureList scoped_feature_list_;
// A map which is a fake representation of the window restore file.
base::flat_map<int32_t, WindowInfo> fake_window_restore_file_;
@ -1271,12 +1265,14 @@ TEST_F(WindowRestoreControllerTest, TopmostWindowIsActivatable) {
// Create a Window Restore'd Chrome app.
AddEntryToFakeFile(
/*restore_id=*/2, gfx::Rect(200, 200), chromeos::WindowStateType::kNormal,
/*restore_window_id=*/2, gfx::Rect(200, 200),
chromeos::WindowStateType::kNormal,
/*activation_index=*/1, WindowTreeHostManager::GetPrimaryDisplayId());
auto* restored_window1 = CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/2, chromeos::AppType::CHROME_APP,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
auto* restored_window1 =
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_window_id=*/2, chromeos::AppType::CHROME_APP,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
EXPECT_THAT(desk_container->children(),
ElementsAre(restored_window1, window.get()));
@ -1313,13 +1309,14 @@ TEST_F(WindowRestoreControllerTest, NextTopmostWindowIsActivatable) {
// Create a minimized Window Restore'd browser. It should not be activatable.
AddEntryToFakeFile(
/*restore_id=*/2, gfx::Rect(200, 200),
/*restore_window_id=*/2, gfx::Rect(200, 200),
chromeos::WindowStateType::kMinimized,
/*activation_index=*/2, WindowTreeHostManager::GetPrimaryDisplayId());
auto* restored_window2 = CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/2, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
auto* restored_window2 =
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_window_id=*/2, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
EXPECT_THAT(desk_container->children(), ElementsAre(restored_window2));
EXPECT_FALSE(wm::CanActivateWindow(restored_window2));
@ -1327,13 +1324,14 @@ TEST_F(WindowRestoreControllerTest, NextTopmostWindowIsActivatable) {
// `restored_window2` in the stacking order. Both restored windows should not
// be activatable because they're minimized.
AddEntryToFakeFile(
/*restore_id=*/3, gfx::Rect(200, 200),
/*restore_window_id=*/3, gfx::Rect(200, 200),
chromeos::WindowStateType::kMinimized,
/*activation_index=*/3, WindowTreeHostManager::GetPrimaryDisplayId());
auto* restored_window3 = CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/3, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
auto* restored_window3 =
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_window_id=*/3, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
EXPECT_THAT(desk_container->children(),
ElementsAre(restored_window3, restored_window2));
EXPECT_FALSE(wm::CanActivateWindow(restored_window3));
@ -1344,12 +1342,14 @@ TEST_F(WindowRestoreControllerTest, NextTopmostWindowIsActivatable) {
// activatable and will be activated so it will be added to the top of the
// stacking order.
AddEntryToFakeFile(
/*restore_id=*/4, gfx::Rect(200, 200), chromeos::WindowStateType::kNormal,
/*restore_window_id=*/4, gfx::Rect(200, 200),
chromeos::WindowStateType::kNormal,
/*activation_index=*/4, WindowTreeHostManager::GetPrimaryDisplayId());
auto* restored_window4 = CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/4, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
auto* restored_window4 =
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_window_id=*/4, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
EXPECT_THAT(
desk_container->children(),
ElementsAre(restored_window3, restored_window2, restored_window4));
@ -1375,14 +1375,15 @@ TEST_F(WindowRestoreControllerTest, WindowsOnInactiveDeskAreNotActivatable) {
// Create a Window Restore'd browser in the third desk. It should not be
// activatable.
AddEntryToFakeFile(
/*restore_id=*/2, gfx::Rect(200, 200),
/*restore_window_id=*/2, gfx::Rect(200, 200),
chromeos::WindowStateType::kMinimized,
/*activation_index=*/2, WindowTreeHostManager::GetPrimaryDisplayId(),
/*desk_id=*/2);
auto* restored_window2 = CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/2, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
auto* restored_window2 =
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_window_id=*/2, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
EXPECT_FALSE(wm::CanActivateWindow(restored_window2));
}
@ -1413,7 +1414,7 @@ TEST_F(WindowRestoreControllerTest, WindowsSavedInOverview) {
// restore, we exit overview.
TEST_F(WindowRestoreControllerTest, WindowsRestoredWhileInOverview) {
AddEntryToFakeFile(
/*restore_id=*/1, gfx::Rect(900, 700, 300, 300),
/*restore_window_id=*/1, gfx::Rect(900, 700, 300, 300),
chromeos::WindowStateType::kNormal);
ToggleOverview();
@ -1421,7 +1422,7 @@ TEST_F(WindowRestoreControllerTest, WindowsRestoredWhileInOverview) {
// Create a restored window. Test that we have exited overview.
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/1, chromeos::AppType::BROWSER,
/*restore_window_id=*/1, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
EXPECT_FALSE(OverviewController::Get()->InOverviewSession());
@ -1436,12 +1437,14 @@ TEST_F(WindowRestoreControllerTest, WindowsMinimumVisibleArea) {
// the bottom right of the current display.
const int window_length = 200;
AddEntryToFakeFile(
/*restore_id=*/1, gfx::Rect(900, 700, window_length, window_length),
/*restore_window_id=*/1,
gfx::Rect(900, 700, window_length, window_length),
chromeos::WindowStateType::kNormal);
auto* restored_window = CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_id=*/1, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
auto* restored_window =
CreateTestWindowRestoredWidgetFromRestoreId(
/*restore_window_id=*/1, chromeos::AppType::BROWSER,
/*is_taskless_arc_app=*/false)
->GetNativeWindow();
const gfx::Rect& bounds_in_screen = restored_window->GetBoundsInScreen();
// Check the intersection of the display bounds and the window bounds in

@ -85,20 +85,7 @@ class AlwaysMaximizeTestState : public WindowState::State {
WindowStateType state_type_;
};
class WindowStateTest : public AshTestBase {
public:
WindowStateTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
WindowStateTest(const WindowStateTest&) = delete;
WindowStateTest& operator=(const WindowStateTest&) = delete;
~WindowStateTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
using WindowStateTest = AshTestBase;
using Sample = base::HistogramBase::Sample;