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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/test/util/ChromeSigninUtilsTest.java

Issue 2800833003: Revert of Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698