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 { class DisplayMoveWindowUtilTest : public AshTestBase {
public: public:
DisplayMoveWindowUtilTest() { DisplayMoveWindowUtilTest() = default;
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kOsSettingsRevampWayfinding},
/*disabled_features=*/{});
}
DisplayMoveWindowUtilTest(const DisplayMoveWindowUtilTest&) = delete; DisplayMoveWindowUtilTest(const DisplayMoveWindowUtilTest&) = delete;
DisplayMoveWindowUtilTest& operator=(const DisplayMoveWindowUtilTest&) = DisplayMoveWindowUtilTest& operator=(const DisplayMoveWindowUtilTest&) =
delete; delete;
~DisplayMoveWindowUtilTest() override = default; ~DisplayMoveWindowUtilTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
}; };
TEST_F(DisplayMoveWindowUtilTest, SingleDisplay) { TEST_F(DisplayMoveWindowUtilTest, SingleDisplay) {

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

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

@@ -25,22 +25,7 @@ using session_manager::SessionState;
namespace ash { namespace ash {
class PersistentWindowControllerTest : public AshTestBase { using PersistentWindowControllerTest = 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_;
};
display::ManagedDisplayInfo CreateDisplayInfo(int64_t id, display::ManagedDisplayInfo CreateDisplayInfo(int64_t id,
const gfx::Rect& bounds) { const gfx::Rect& bounds) {

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

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

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

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

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

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

@@ -85,20 +85,7 @@ class AlwaysMaximizeTestState : public WindowState::State {
WindowStateType state_type_; WindowStateType state_type_;
}; };
class WindowStateTest : public AshTestBase { using WindowStateTest = 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 Sample = base::HistogramBase::Sample; using Sample = base::HistogramBase::Sample;