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

Commit c5c46a66 authored by Charles Chen's avatar Charles Chen
Browse files

Fix testCreateWindowContextNewTokenFromClient

Since we change #detachWindowContext as an one-way method,
and the WindowToken may have not been detached yet,
using a pollingCheck to prevent the timing issue.

Test: atest WindowContextTest
Fixes: 409577481
Flag: EXEMPT bugfix
Change-Id: Ib6eaa58faa3d68bbb5d85439af5f6389af042d65
parent 0042186e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -185,7 +185,14 @@ public class WindowContextTest {
        mWindowContext.release();

        // After the window context's release, the window token is also removed.
        assertFalse("Token must be removed after release.", mWms.isWindowToken(token));
        PollingCheck.waitFor(() -> {
            try {
                return !mWms.isWindowToken(token);
            } catch (RemoteException e) {
                fail("Fail to call isWindowToken:" + e);
                return false;
            }
        });
    }

    /**