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

Commit 89a045c3 authored by Deepanshu Gupta's avatar Deepanshu Gupta
Browse files

Revert to using AppTheme for LayoutLib tests.

Use AppTheme for all tests other than testExpand. AppTheme contains an
attribute needed by testArrayCheck. Also, since the AppTheme extends
Theme.Material.Light.DarkActionBar, other tests should be unaffected.

Also, update the golden image for the testArrayCheck.

Change-Id: Ib5f53f3b029c5aceef2b622e5ac63952d6b1972a
parent 9f280a93
Loading
Loading
Loading
Loading
−4.49 KiB (5.07 KiB)
Loading image diff...
+7 −7
Original line number Diff line number Diff line
@@ -329,8 +329,8 @@ public class Main {
                .setNavigation(Navigation.NONAV);

        SessionParams params = getSessionParams(parser, customConfigGenerator,
                layoutLibCallback, "Theme.Material.NoActionBar.Fullscreen", RenderingMode.V_SCROLL,
                22);
                layoutLibCallback, "Theme.Material.NoActionBar.Fullscreen", false,
                RenderingMode.V_SCROLL, 22);

        renderAndVerify(params, "expand_vert_layout.png");

@@ -342,8 +342,8 @@ public class Main {
        parser = new LayoutPullParser(APP_TEST_RES + "/layout/" +
                "expand_horz_layout.xml");
        params = getSessionParams(parser, customConfigGenerator,
                layoutLibCallback, "Theme.Material.NoActionBar.Fullscreen", RenderingMode
                        .H_SCROLL, 22);
                layoutLibCallback, "Theme.Material.NoActionBar.Fullscreen", false,
                RenderingMode.H_SCROLL, 22);

        renderAndVerify(params, "expand_horz_layout.png");
    }
@@ -390,7 +390,7 @@ public class Main {
        // TODO: Set up action bar handler properly to test menu rendering.
        // Create session params.
        SessionParams params = getSessionParams(parser, ConfigGenerator.NEXUS_5,
                layoutLibCallback, "Theme.Material.Light.DarkActionBar", RenderingMode.NORMAL, 22);
                layoutLibCallback, "AppTheme", true, RenderingMode.NORMAL, 22);
        renderAndVerify(params, goldenFileName);
    }

@@ -399,12 +399,12 @@ public class Main {
     */
    private SessionParams getSessionParams(LayoutPullParser layoutParser,
            ConfigGenerator configGenerator, LayoutLibTestCallback layoutLibCallback,
            String themeName, RenderingMode renderingMode, int targetSdk) {
            String themeName, boolean isProjectTheme, RenderingMode renderingMode, int targetSdk) {
        FolderConfiguration config = configGenerator.getFolderConfig();
        ResourceResolver resourceResolver =
                ResourceResolver.create(sProjectResources.getConfiguredResources(config),
                        sFrameworkRepo.getConfiguredResources(config),
                        themeName, false);
                        themeName, isProjectTheme);

        return new SessionParams(
                layoutParser,