| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.signin; | 5 package org.chromium.chrome.browser.signin; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.support.test.InstrumentationRegistry; | 8 import android.support.test.InstrumentationRegistry; |
| 9 import android.support.test.filters.SmallTest; | 9 import android.support.test.filters.SmallTest; |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 mEventChecker.insertRenameEvent("C", "D"); | 143 mEventChecker.insertRenameEvent("C", "D"); |
| 144 mEventChecker.insertRenameEvent("D", "A"); // Looped. | 144 mEventChecker.insertRenameEvent("D", "A"); // Looped. |
| 145 Account account = AccountManagerHelper.createAccountFromName("D"); | 145 Account account = AccountManagerHelper.createAccountFromName("D"); |
| 146 AccountHolder accountHolder = AccountHolder.builder(account).build(); | 146 AccountHolder accountHolder = AccountHolder.builder(account).build(); |
| 147 mAccountManager.addAccountHolderExplicitly(accountHolder); | 147 mAccountManager.addAccountHolderExplicitly(accountHolder); |
| 148 SigninHelper.updateAccountRenameData(mContext, mEventChecker); | 148 SigninHelper.updateAccountRenameData(mContext, mEventChecker); |
| 149 Assert.assertEquals("D", getNewSignedInAccountName()); | 149 Assert.assertEquals("D", getNewSignedInAccountName()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 private void setSignedInAccountName(String account) { | 152 private void setSignedInAccountName(String account) { |
| 153 ChromeSigninController.get().setSignedInAccountName(account); | 153 ChromeSigninController.get(mContext).setSignedInAccountName(account); |
| 154 } | 154 } |
| 155 | 155 |
| 156 private String getSignedInAccountName() { | 156 private String getSignedInAccountName() { |
| 157 return ChromeSigninController.get().getSignedInAccountName(); | 157 return ChromeSigninController.get(mContext).getSignedInAccountName(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 private String getNewSignedInAccountName() { | 160 private String getNewSignedInAccountName() { |
| 161 return SigninHelper.getNewSignedInAccountName(mContext); | 161 return SigninHelper.getNewSignedInAccountName(mContext); |
| 162 } | 162 } |
| 163 } | 163 } |
| OLD | NEW |