| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.sync; | 5 package org.chromium.chrome.browser.sync; |
| 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.support.test.filters.LargeTest; | 9 import android.support.test.filters.LargeTest; |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // Tell the fake content resolver that a rename had happen and c
opy over the sync | 118 // Tell the fake content resolver that a rename had happen and c
opy over the sync |
| 119 // settings. This would normally be done by the SystemSyncConten
tResolver. | 119 // settings. This would normally be done by the SystemSyncConten
tResolver. |
| 120 mSyncContentResolver.renameAccounts( | 120 mSyncContentResolver.renameAccounts( |
| 121 oldAccount, newAccount, AndroidSyncSettings.getContractA
uthority(mContext)); | 121 oldAccount, newAccount, AndroidSyncSettings.getContractA
uthority(mContext)); |
| 122 | 122 |
| 123 // Inform the AccountTracker, these would normally be done by ac
count validation | 123 // Inform the AccountTracker, these would normally be done by ac
count validation |
| 124 // or signin. We will only be calling the testing versions of it
. | 124 // or signin. We will only be calling the testing versions of it
. |
| 125 AccountIdProvider provider = AccountIdProvider.getInstance(); | 125 AccountIdProvider provider = AccountIdProvider.getInstance(); |
| 126 String[] accountNames = {oldAccount.name, newAccount.name}; | 126 String[] accountNames = {oldAccount.name, newAccount.name}; |
| 127 String[] accountIds = {provider.getAccountId(mContext, accountNa
mes[0]), | 127 String[] accountIds = {provider.getAccountId(accountNames[0]), |
| 128 provider.getAccountId(mContext, accountNa
mes[1])}; | 128 provider.getAccountId(accountNames[1])}; |
| 129 AccountTrackerService.get(mContext).syncForceRefreshForTest( | 129 AccountTrackerService.get().syncForceRefreshForTest(accountIds,
accountNames); |
| 130 accountIds, accountNames); | |
| 131 | 130 |
| 132 // Starts the rename process. Normally, this is triggered by the
broadcast | 131 // Starts the rename process. Normally, this is triggered by the
broadcast |
| 133 // listener as well. | 132 // listener as well. |
| 134 SigninHelper.get(mContext).validateAccountSettings(true); | 133 SigninHelper.get(mContext).validateAccountSettings(true); |
| 135 } | 134 } |
| 136 }); | 135 }); |
| 137 | 136 |
| 138 CriteriaHelper.pollInstrumentationThread(new Criteria() { | 137 CriteriaHelper.pollInstrumentationThread(new Criteria() { |
| 139 @Override | 138 @Override |
| 140 public boolean isSatisfied() { | 139 public boolean isSatisfied() { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 204 |
| 206 mSyncContentResolver.setMasterSyncAutomatically(false); | 205 mSyncContentResolver.setMasterSyncAutomatically(false); |
| 207 startSync(); | 206 startSync(); |
| 208 assertFalse(SyncTestUtil.isSyncRequested()); | 207 assertFalse(SyncTestUtil.isSyncRequested()); |
| 209 } | 208 } |
| 210 | 209 |
| 211 private static ContentViewCore getContentViewCore(ChromeActivity activity) { | 210 private static ContentViewCore getContentViewCore(ChromeActivity activity) { |
| 212 return activity.getActivityTab().getContentViewCore(); | 211 return activity.getActivityTab().getContentViewCore(); |
| 213 } | 212 } |
| 214 } | 213 } |
| OLD | NEW |