| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.invalidation; | 5 package org.chromium.chrome.browser.invalidation; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.Application; | 9 import android.app.Application; |
| 10 import android.content.ContentResolver; | 10 import android.content.ContentResolver; |
| 11 import android.content.Context; | 11 import android.content.Context; |
| 12 import android.content.Intent; | 12 import android.content.Intent; |
| 13 import android.content.SyncResult; | 13 import android.content.SyncResult; |
| 14 import android.os.Bundle; | 14 import android.os.Bundle; |
| 15 import android.test.suitebuilder.annotation.MediumTest; | 15 import android.test.suitebuilder.annotation.MediumTest; |
| 16 | 16 |
| 17 import org.chromium.base.ApplicationStatus; | 17 import org.chromium.base.ApplicationStatus; |
| 18 import org.chromium.base.CommandLine; | 18 import org.chromium.base.CommandLine; |
| 19 import org.chromium.base.test.util.Feature; | 19 import org.chromium.base.test.util.Feature; |
| 20 import org.chromium.base.test.util.ScalableTimeout; | 20 import org.chromium.base.test.util.ScalableTimeout; |
| 21 import org.chromium.chrome.browser.ChromeActivity; | 21 import org.chromium.chrome.browser.ChromeActivity; |
| 22 import org.chromium.chrome.test.ChromeActivityTestCaseBase; | 22 import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| 23 import org.chromium.components.invalidation.PendingInvalidation; | 23 import org.chromium.components.invalidation.PendingInvalidation; |
| 24 import org.chromium.components.sync.AndroidSyncSettings; |
| 25 import org.chromium.components.sync.signin.AccountManagerHelper; |
| 24 import org.chromium.content.browser.test.util.Criteria; | 26 import org.chromium.content.browser.test.util.Criteria; |
| 25 import org.chromium.content.browser.test.util.CriteriaHelper; | 27 import org.chromium.content.browser.test.util.CriteriaHelper; |
| 26 import org.chromium.sync.AndroidSyncSettings; | |
| 27 import org.chromium.sync.signin.AccountManagerHelper; | |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * Tests for ChromeBrowserSyncAdapter. | 30 * Tests for ChromeBrowserSyncAdapter. |
| 31 */ | 31 */ |
| 32 public class ChromeBrowserSyncAdapterTest extends ChromeActivityTestCaseBase<Chr
omeActivity> { | 32 public class ChromeBrowserSyncAdapterTest extends ChromeActivityTestCaseBase<Chr
omeActivity> { |
| 33 private static final Account TEST_ACCOUNT = | 33 private static final Account TEST_ACCOUNT = |
| 34 AccountManagerHelper.createAccountFromName("test@gmail.com"); | 34 AccountManagerHelper.createAccountFromName("test@gmail.com"); |
| 35 private static final long WAIT_FOR_LAUNCHER_MS = ScalableTimeout.scaleTimeou
t(10 * 1000); | 35 private static final long WAIT_FOR_LAUNCHER_MS = ScalableTimeout.scaleTimeou
t(10 * 1000); |
| 36 private static final long POLL_INTERVAL_MS = 100; | 36 private static final long POLL_INTERVAL_MS = 100; |
| 37 | 37 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 @MediumTest | 144 @MediumTest |
| 145 @Feature({"Sync"}) | 145 @Feature({"Sync"}) |
| 146 public void testRequestInitializeSync() throws InterruptedException { | 146 public void testRequestInitializeSync() throws InterruptedException { |
| 147 Bundle extras = new Bundle(); | 147 Bundle extras = new Bundle(); |
| 148 extras.putBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, true); | 148 extras.putBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, true); |
| 149 performSyncWithBundle(extras); | 149 performSyncWithBundle(extras); |
| 150 assertFalse(mSyncAdapter.mInvalidatedAllTypes); | 150 assertFalse(mSyncAdapter.mInvalidatedAllTypes); |
| 151 assertFalse(mSyncAdapter.mInvalidated); | 151 assertFalse(mSyncAdapter.mInvalidated); |
| 152 } | 152 } |
| 153 } | 153 } |
| OLD | NEW |