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

Commit 99066c90 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

Fix failing WebViewUpdateServiceTest.

WebViewUpdateServiceTest#testPreparationRunsIffNewPackage was failing
since the fix for b/140129991 was implemented, as we no longer consider
the update time of the package and early-out of triggering a preparation
run, to avoid issues with static shared library dependencies.

Remove the logic in the test that tries to prove we don't run additional
preparation passes when trivial package replacements occur, as we no
longer consider any package replacement to be trivial.

Bug: 140129991
Test: atest WebViewUpdateServiceTest
Change-Id: I5dcb31a915392726f9f87bad29ad278ce75593cf
parent 0ed16d7b
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -1275,25 +1275,8 @@ public class WebViewUpdateServiceTest {
                    true /* valid */, true /* installed */));

        runWebViewBootPreparationOnMainSync();

        checkPreparationPhasesForPackage(primaryPackage, 1 /* first preparation phase */);

        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0 /* userId */);
        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 1 /* userId */);
        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 2 /* userId */);
        // package still has the same update-time so we shouldn't run preparation here
        Mockito.verify(mTestSystemImpl, Mockito.times(1)).onWebViewProviderChanged(
                Mockito.argThat(new IsPackageInfoWithName(primaryPackage)));

        // Ensure we can still load the package
        WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider();
        assertEquals(WebViewFactory.LIBLOAD_SUCCESS, response.status);
        assertEquals(primaryPackage, response.packageInfo.packageName);


        mTestSystemImpl.setPackageInfo(createPackageInfo(primaryPackage, true /* enabled */,
                    true /* valid */, true /* installed */, null /* signatures */,
                    20 /* lastUpdateTime*/ ));