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

Commit 24426750 authored by Primiano Tucci's avatar Primiano Tucci
Browse files

Adding freeMemoryForTests static method to WebView.

This is going to be used by pagecycler tests.
See: b/10629847

Change-Id: Ie3fda214e7808429d7ed63734ab301525f58513f
parent d6b37fdf
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -710,6 +710,16 @@ public class WebView extends AbsoluteLayout
        getFactory().getStatics().setPlatformNotificationsEnabled(false);
    }

    /**
     * Used only by internal tests to free up memory.
     *
     * @hide
     */
    public static void freeMemoryForTests() {
        checkThread();
        getFactory().getStatics().freeMemoryForTests();
    }

    /**
     * Informs WebView of the network state. This is used to set
     * the JavaScript property window.navigator.isOnline and
+4 −0
Original line number Diff line number Diff line
@@ -1320,6 +1320,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                WebViewClassic.disablePlatformNotifications();
            }
        }
        @Override
        public void freeMemoryForTests() {
            // noop.
        }

        @Override
        public Statics getStatics() { return this; }
+5 −0
Original line number Diff line number Diff line
@@ -48,6 +48,11 @@ public interface WebViewFactoryProvider {
         * {@link android.webkit.WebSettings#getDefaultUserAgent(Context) }
         */
        String getDefaultUserAgent(Context context);

        /**
         * Used for tests only.
         */
         void freeMemoryForTests();
    }

    Statics getStatics();