Explicitly clear cookies at the start of CookieSyncManagerTest.

I may be misunderstanding the intention behind this test, but as
written it can fail if there are already cookies in the store.
To make it pass consistently, this CL clears out existing cookies
at the start of the test.

BUG=3241780

Change-Id: I94843f424b4b371fcdf1c38621feb3354700ded1
diff --git a/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java b/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java
index 1a8ccb9..391478a 100644
--- a/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java
@@ -62,7 +62,15 @@
         assertSame(csm1, csm2);
 
         final CookieManager cookieManager = CookieManager.getInstance();
-        assertFalse(cookieManager.hasCookies());
+
+        // Remove all cookies from the database.
+        cookieManager.removeAllCookie();
+        new DelayedCheck(30000) {
+            @Override
+            protected boolean check() {
+                return !cookieManager.hasCookies();
+            }
+        }.run();
 
         cookieManager.setAcceptCookie(true);
         assertTrue(cookieManager.acceptCookie());
@@ -77,7 +85,7 @@
 
         // Store the cookie to the database.
         csm1.sync();
-        new DelayedCheck(10000) {
+        new DelayedCheck(30000) {
             @Override
             protected boolean check() {
                 return cookieManager.hasCookies();
@@ -86,7 +94,7 @@
 
         // Remove all cookies from the database.
         cookieManager.removeAllCookie();
-        new DelayedCheck(10000) {
+        new DelayedCheck(30000) {
             @Override
             protected boolean check() {
                 return !cookieManager.hasCookies();