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

Commit 14a2d2fb authored by Primiano Tucci's avatar Primiano Tucci Committed by Android (Google) Code Review
Browse files

Merge "Adding freeMemoryForTests static method to WebView."

parents 6304f68d 24426750
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();