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.test.util; | 5 package org.chromium.chrome.test.util; |
6 | 6 |
7 import android.support.test.InstrumentationRegistry; | 7 import android.support.test.InstrumentationRegistry; |
8 import android.support.test.filters.SmallTest; | 8 import android.support.test.filters.SmallTest; |
9 | 9 |
10 import org.junit.After; | 10 import org.junit.After; |
(...skipping 18 matching lines...) Expand all Loading... |
29 private static final String GOOGLE_ACCOUNT_USERNAME = "chromiumforandroid01@
gmail.com"; | 29 private static final String GOOGLE_ACCOUNT_USERNAME = "chromiumforandroid01@
gmail.com"; |
30 private static final String GOOGLE_ACCOUNT_PASSWORD = "chromeforandroid"; | 30 private static final String GOOGLE_ACCOUNT_PASSWORD = "chromeforandroid"; |
31 private static final String GOOGLE_ACCOUNT_TYPE = "mail"; | 31 private static final String GOOGLE_ACCOUNT_TYPE = "mail"; |
32 | 32 |
33 private ChromeSigninUtils mSigninUtil; | 33 private ChromeSigninUtils mSigninUtil; |
34 private ChromeSigninController mSigninController; | 34 private ChromeSigninController mSigninController; |
35 | 35 |
36 @Before | 36 @Before |
37 public void setUp() throws Exception { | 37 public void setUp() throws Exception { |
38 mSigninUtil = new ChromeSigninUtils(InstrumentationRegistry.getInstrumen
tation()); | 38 mSigninUtil = new ChromeSigninUtils(InstrumentationRegistry.getInstrumen
tation()); |
39 mSigninController = ChromeSigninController.get( | 39 mSigninController = ChromeSigninController.get(); |
40 InstrumentationRegistry.getInstrumentation().getTargetContext())
; | |
41 mSigninController.setSignedInAccountName(null); | 40 mSigninController.setSignedInAccountName(null); |
42 mSigninUtil.removeAllFakeAccountsFromOs(); | 41 mSigninUtil.removeAllFakeAccountsFromOs(); |
43 mSigninUtil.removeAllGoogleAccountsFromOs(); | 42 mSigninUtil.removeAllGoogleAccountsFromOs(); |
44 } | 43 } |
45 | 44 |
46 @Test | 45 @Test |
47 @SmallTest | 46 @SmallTest |
48 public void testActivityIsNotSignedInOnAppOrFakeOSorGoogleOS() { | 47 public void testActivityIsNotSignedInOnAppOrFakeOSorGoogleOS() { |
49 Assert.assertFalse("Should not be signed into app.", mSigninController.i
sSignedIn()); | 48 Assert.assertFalse("Should not be signed into app.", mSigninController.i
sSignedIn()); |
50 Assert.assertFalse("Should not be signed into OS with fake account.", | 49 Assert.assertFalse("Should not be signed into OS with fake account.", |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 mSigninUtil.isExistingGoogleAccountOnOs(GOOGLE_ACCOUNT_USERNAME)
); | 146 mSigninUtil.isExistingGoogleAccountOnOs(GOOGLE_ACCOUNT_USERNAME)
); |
148 } | 147 } |
149 | 148 |
150 @After | 149 @After |
151 public void tearDown() throws Exception { | 150 public void tearDown() throws Exception { |
152 mSigninController.setSignedInAccountName(null); | 151 mSigninController.setSignedInAccountName(null); |
153 mSigninUtil.removeAllFakeAccountsFromOs(); | 152 mSigninUtil.removeAllFakeAccountsFromOs(); |
154 mSigninUtil.removeAllGoogleAccountsFromOs(); | 153 mSigninUtil.removeAllGoogleAccountsFromOs(); |
155 } | 154 } |
156 } | 155 } |
OLD | NEW |