Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 037f522d authored by Eric Lin's avatar Eric Lin
Browse files

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
parent 362599f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment