OSDN Git Service

Adding freeMemoryForTests static method to WebView.
authorSelim Gurun <sgurun@android.com>
Thu, 23 Jan 2014 19:21:00 +0000 (11:21 -0800)
committerSelim Gurun <sgurun@android.com>
Thu, 23 Jan 2014 19:21:00 +0000 (11:21 -0800)
This is going to be used by pagecycler tests.
Bug: b/10629847

(cherry picked from commit 54daaf1cffddad6366fac2ccfceb1e042dd8e90e)

Change-Id: Ie16a94baa15f868d60f3837290dcc8045aea31a9

core/java/android/webkit/WebView.java
core/java/android/webkit/WebViewFactoryProvider.java

index 5bc39f1..f276e14 100644 (file)
@@ -686,6 +686,15 @@ public class WebView extends AbsoluteLayout
     }
 
     /**
+     * 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
      * generates the online/offline event as specified in HTML5, sec. 5.7.7
index 9d9d882..e391aaf 100644 (file)
@@ -50,6 +50,11 @@ public interface WebViewFactoryProvider {
         String getDefaultUserAgent(Context context);
 
         /**
+         * Used for tests only.
+         */
+         void freeMemoryForTests();
+
+        /**
          * Implements the API method:
          * {@link android.webkit.WebView#setWebContentsDebuggingEnabled(boolean) }
          */