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

Commit 177a4bb3 authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Add useMinimalMemory=true test to TileBenchmark"

parents e66b1da6 9e6fa17b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -276,6 +276,22 @@ public class PerformanceTest extends
        }
    }

    public void testMetricsMinimalMemory() {
        mActivity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                mWeb.setUseMinimalMemory(true);
            }
        });

        setScrollingTestingMode(true);
        if (checkMedia() && runTestDirs(SCROLL_TEST_DIRS)) {
            getInstrumentation().sendStatus(0, mStats.getBundle());
        } else {
            getInstrumentation().sendStatus(1, null);
        }
    }

    private boolean runAnimationTests() {
        for (int doubleBuffer = 0; doubleBuffer <= 1; doubleBuffer++) {
            mDoubleBuffering = doubleBuffer == 1;
+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,11 @@ public class ProfiledWebView extends WebView implements WebViewClassic.PageSwapD
        mLoadTime = 0;
    }

    public void setUseMinimalMemory(boolean minimal) {
        WebSettingsClassic settings = getWebViewClassic().getSettings();
        settings.setProperty("use_minimal_memory", minimal ? "true" : "false");
    }

    public void onPageFinished() {
        mLoadTime = System.currentTimeMillis();
    }