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())
; |
40 mSigninController.setSignedInAccountName(null); | 41 mSigninController.setSignedInAccountName(null); |
41 mSigninUtil.removeAllFakeAccountsFromOs(); | 42 mSigninUtil.removeAllFakeAccountsFromOs(); |
42 mSigninUtil.removeAllGoogleAccountsFromOs(); | 43 mSigninUtil.removeAllGoogleAccountsFromOs(); |
43 } | 44 } |
44 | 45 |
45 @Test | 46 @Test |
46 @SmallTest | 47 @SmallTest |
47 public void testActivityIsNotSignedInOnAppOrFakeOSorGoogleOS() { | 48 public void testActivityIsNotSignedInOnAppOrFakeOSorGoogleOS() { |
48 Assert.assertFalse("Should not be signed into app.", mSigninController.i
sSignedIn()); | 49 Assert.assertFalse("Should not be signed into app.", mSigninController.i
sSignedIn()); |
49 Assert.assertFalse("Should not be signed into OS with fake account.", | 50 Assert.assertFalse("Should not be signed into OS with fake account.", |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 mSigninUtil.isExistingGoogleAccountOnOs(GOOGLE_ACCOUNT_USERNAME)
); | 147 mSigninUtil.isExistingGoogleAccountOnOs(GOOGLE_ACCOUNT_USERNAME)
); |
147 } | 148 } |
148 | 149 |
149 @After | 150 @After |
150 public void tearDown() throws Exception { | 151 public void tearDown() throws Exception { |
151 mSigninController.setSignedInAccountName(null); | 152 mSigninController.setSignedInAccountName(null); |
152 mSigninUtil.removeAllFakeAccountsFromOs(); | 153 mSigninUtil.removeAllFakeAccountsFromOs(); |
153 mSigninUtil.removeAllGoogleAccountsFromOs(); | 154 mSigninUtil.removeAllGoogleAccountsFromOs(); |
154 } | 155 } |
155 } | 156 } |
OLD | NEW |