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.app.Activity; | 7 import android.app.Activity; |
8 import android.app.DialogFragment; | 8 import android.app.DialogFragment; |
9 import android.app.Fragment; | 9 import android.app.Fragment; |
10 import android.app.Instrumentation.ActivityMonitor; | 10 import android.app.Instrumentation.ActivityMonitor; |
(...skipping 21 matching lines...) Expand all Loading... |
32 import org.chromium.components.bookmarks.BookmarkId; | 32 import org.chromium.components.bookmarks.BookmarkId; |
33 import org.chromium.components.signin.ChromeSigninController; | 33 import org.chromium.components.signin.ChromeSigninController; |
34 import org.chromium.content.browser.test.util.TestTouchUtils; | 34 import org.chromium.content.browser.test.util.TestTouchUtils; |
35 | 35 |
36 /** | 36 /** |
37 * Test suite for sign in tests. | 37 * Test suite for sign in tests. |
38 * | 38 * |
39 * These tests cover the sign in flow for both consumer and managed accounts. Th
ey also verify | 39 * These tests cover the sign in flow for both consumer and managed accounts. Th
ey also verify |
40 * the state of the browser while signed in, and any changes when signing out. | 40 * the state of the browser while signed in, and any changes when signing out. |
41 * | 41 * |
42 * The accounts used to sign in are mocked by a MockAccountManager. | 42 * The accounts used to sign in are mocked by a FakeAccountManagerDelegate. |
43 */ | 43 */ |
44 public class SigninTest extends ChromeTabbedActivityTestBase { | 44 public class SigninTest extends ChromeTabbedActivityTestBase { |
45 | 45 |
46 /** | 46 /** |
47 * Helper class that observes when signing in becomes allowed. | 47 * Helper class that observes when signing in becomes allowed. |
48 */ | 48 */ |
49 private static class TestSignInAllowedObserver implements SigninManager.Sign
InAllowedObserver { | 49 private static class TestSignInAllowedObserver implements SigninManager.Sign
InAllowedObserver { |
50 private final Object mLock = new Object(); | 50 private final Object mLock = new Object(); |
51 private boolean mIsSignInAllowed; | 51 private boolean mIsSignInAllowed; |
52 private SigninManager mSigninManager; | 52 private SigninManager mSigninManager; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 getInstrumentation().waitForIdleSync(); | 425 getInstrumentation().waitForIdleSync(); |
426 DialogFragment fragment = ActivityUtils.waitForFragment(activity, tag); | 426 DialogFragment fragment = ActivityUtils.waitForFragment(activity, tag); |
427 AlertDialog dialog = (AlertDialog) fragment.getDialog(); | 427 AlertDialog dialog = (AlertDialog) fragment.getDialog(); |
428 assertTrue(dialog != null); | 428 assertTrue(dialog != null); |
429 assertTrue(dialog.isShowing()); | 429 assertTrue(dialog.isShowing()); |
430 Button button = dialog.getButton(DialogInterface.BUTTON_POSITIVE); | 430 Button button = dialog.getButton(DialogInterface.BUTTON_POSITIVE); |
431 assertNotNull("Could not find the accept button.", button); | 431 assertNotNull("Could not find the accept button.", button); |
432 TestTouchUtils.performClickOnMainSync(getInstrumentation(), button); | 432 TestTouchUtils.performClickOnMainSync(getInstrumentation(), button); |
433 } | 433 } |
434 } | 434 } |
OLD | NEW |