| 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(accountNames[0]), | 127 String[] accountIds = {provider.getAccountId(mContext, accountNa
mes[0]), |
| 128 provider.getAccountId(accountNames[1])}; | 128 provider.getAccountId(mContext, accountNa
mes[1])}; |
| 129 AccountTrackerService.get().syncForceRefreshForTest(accountIds,
accountNames); | 129 AccountTrackerService.get(mContext).syncForceRefreshForTest( |
| 130 accountIds, accountNames); |
| 130 | 131 |
| 131 // Starts the rename process. Normally, this is triggered by the
broadcast | 132 // Starts the rename process. Normally, this is triggered by the
broadcast |
| 132 // listener as well. | 133 // listener as well. |
| 133 SigninHelper.get(mContext).validateAccountSettings(true); | 134 SigninHelper.get(mContext).validateAccountSettings(true); |
| 134 } | 135 } |
| 135 }); | 136 }); |
| 136 | 137 |
| 137 CriteriaHelper.pollInstrumentationThread(new Criteria() { | 138 CriteriaHelper.pollInstrumentationThread(new Criteria() { |
| 138 @Override | 139 @Override |
| 139 public boolean isSatisfied() { | 140 public boolean isSatisfied() { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 205 |
| 205 mSyncContentResolver.setMasterSyncAutomatically(false); | 206 mSyncContentResolver.setMasterSyncAutomatically(false); |
| 206 startSync(); | 207 startSync(); |
| 207 assertFalse(SyncTestUtil.isSyncRequested()); | 208 assertFalse(SyncTestUtil.isSyncRequested()); |
| 208 } | 209 } |
| 209 | 210 |
| 210 private static ContentViewCore getContentViewCore(ChromeActivity activity) { | 211 private static ContentViewCore getContentViewCore(ChromeActivity activity) { |
| 211 return activity.getActivityTab().getContentViewCore(); | 212 return activity.getActivityTab().getContentViewCore(); |
| 212 } | 213 } |
| 213 } | 214 } |
| OLD | NEW |