Move MockToken to shared test utils module.
This change moves MockToken test utility from WMShellUnitTests module to WMShellTests-utils module to enable sharing across multiple WM shell test modules (WMShellUnitTests, WMShellRobolectricTests, and WMShellMultivalentTestsOnDevice). The implementation has been rewritten from Java to Kotlin to provide more idiomatic static-style access for new Kotlin code while maintaining backward compatibility for existing Java and Kotlin tests. The refactored MockToken now offers multiple access patterns: legacy instance-based access (`new MockToken().token()` for Java, `MockToken().token()` for Kotlin) and modern static access (`MockToken.token()` for Kotlin). This change is applied in BubbleTaskStackListenerTest, replacing the inline mock creation with the shared utility. Sharing MockToken across WM shell tests improves test maintenance by eliminating code duplication and enhances code readability by providing a consistent mocking approach for WindowContainerToken instances. Bug: 387193964 Flag: EXEMPT bug fix Test: atest WMShellRobolectricTests:BubbleExpandedViewTest Test: atest WMShellRobolectricTests:BubbleTaskStackListenerTest Test: atest WMShellRobolectricTests:BubbleTaskViewListenerTest Test: atest WMShellMultivalentTestsOnDevice:BubbleExpandedViewTest Test: atest WMShellMultivalentTestsOnDevice:BubbleTaskStackListenerTest Test: atest WMShellMultivalentTestsOnDevice:BubbleTaskViewListenerTest Test: atest WMShellUnitTests:BubbleTransitionsTest Test: atest WMShellUnitTests:WindowDecorationTests Test: m WMShellMultivalentTestsOnDevice WMShellRobolectricTests WMShellUnitTests Change-Id: Ic08d064f09448cb54cc8d8862370bff38b1d772a
Loading
Please register or sign in to comment