Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: components/sync/android/javatests/src/org/chromium/components/sync/notifier/signin/AccountManagerHelperTest.java

Issue 2351703003: Refactor: move components/sync/../signin to components/signin/../ (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/android/javatests/src/org/chromium/components/sync/notifier/signin/AccountManagerHelperTest.java
diff --git a/components/sync/android/javatests/src/org/chromium/components/sync/notifier/signin/AccountManagerHelperTest.java b/components/sync/android/javatests/src/org/chromium/components/sync/notifier/signin/AccountManagerHelperTest.java
deleted file mode 100644
index 56728f553e881ece88472516c9cdf3cf2bf22a8e..0000000000000000000000000000000000000000
--- a/components/sync/android/javatests/src/org/chromium/components/sync/notifier/signin/AccountManagerHelperTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.components.sync.notifier.signin;
-
-import android.accounts.Account;
-import android.content.Context;
-import android.test.InstrumentationTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.chromium.components.sync.signin.AccountManagerHelper;
-import org.chromium.components.sync.test.util.AccountHolder;
-import org.chromium.components.sync.test.util.MockAccountManager;
-import org.chromium.components.sync.test.util.SimpleFuture;
-
-/**
- * Test class for {@link AccountManagerHelper}.
- */
-public class AccountManagerHelperTest extends InstrumentationTestCase {
- private MockAccountManager mAccountManager;
- private AccountManagerHelper mHelper;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- Context context = getInstrumentation().getTargetContext();
- mAccountManager = new MockAccountManager(context, context);
- AccountManagerHelper.overrideAccountManagerHelperForTests(context, mAccountManager);
- mHelper = AccountManagerHelper.get(context);
- }
-
- @SmallTest
- public void testCanonicalAccount() throws InterruptedException {
- addTestAccount("test@gmail.com", "password");
-
- assertTrue(hasAccountForName("test@gmail.com"));
- assertTrue(hasAccountForName("Test@gmail.com"));
- assertTrue(hasAccountForName("te.st@gmail.com"));
- }
-
- // If this test starts flaking, please re-open crbug.com/568636 and make sure there is some sort
- // of stack trace or error message in that bug BEFORE disabling the test.
- @SmallTest
- public void testNonCanonicalAccount() throws InterruptedException {
- addTestAccount("test.me@gmail.com", "password");
-
- assertTrue(hasAccountForName("test.me@gmail.com"));
- assertTrue(hasAccountForName("testme@gmail.com"));
- assertTrue(hasAccountForName("Testme@gmail.com"));
- assertTrue(hasAccountForName("te.st.me@gmail.com"));
- }
-
- private Account addTestAccount(String accountName, String password) {
- Account account = AccountManagerHelper.createAccountFromName(accountName);
- AccountHolder.Builder accountHolder =
- AccountHolder.create().account(account).password(password).alwaysAccept(true);
- mAccountManager.addAccountHolderExplicitly(accountHolder.build());
- return account;
- }
-
- private boolean hasAccountForName(String accountName) throws InterruptedException {
- SimpleFuture<Boolean> result = new SimpleFuture<Boolean>();
- mHelper.hasAccountForName(accountName, result.createCallback());
- return result.get();
- }
-}

Powered by Google App Engine
This is Rietveld 408576698