| 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.net; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import static org.hamcrest.CoreMatchers.equalTo; | 7 import static org.hamcrest.CoreMatchers.equalTo; |
| 8 import static org.hamcrest.CoreMatchers.notNullValue; | 8 import static org.hamcrest.CoreMatchers.notNullValue; |
| 9 import static org.hamcrest.CoreMatchers.nullValue; | 9 import static org.hamcrest.CoreMatchers.nullValue; |
| 10 import static org.junit.Assert.assertThat; | 10 import static org.junit.Assert.assertThat; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 @Captor | 91 @Captor |
| 92 private ArgumentCaptor<AccountManagerCallback<Bundle>> mBundleCallbackCaptor
; | 92 private ArgumentCaptor<AccountManagerCallback<Bundle>> mBundleCallbackCaptor
; |
| 93 @Captor | 93 @Captor |
| 94 private ArgumentCaptor<AccountManagerCallback<Account[]>> mAccountCallbackCa
ptor; | 94 private ArgumentCaptor<AccountManagerCallback<Account[]>> mAccountCallbackCa
ptor; |
| 95 @Captor | 95 @Captor |
| 96 private ArgumentCaptor<Bundle> mBundleCaptor; | 96 private ArgumentCaptor<Bundle> mBundleCaptor; |
| 97 | 97 |
| 98 @Before | 98 @Before |
| 99 public void setUp() { | 99 public void setUp() { |
| 100 MockitoAnnotations.initMocks(this); | 100 MockitoAnnotations.initMocks(this); |
| 101 ContextUtils.initApplicationContextForJUnitTests(Robolectric.application
); | 101 ContextUtils.initApplicationContextForTests(Robolectric.application); |
| 102 } | 102 } |
| 103 | 103 |
| 104 @After | 104 @After |
| 105 public void tearDown() { | 105 public void tearDown() { |
| 106 ApplicationStatus.destroyForJUnitTests(); | 106 ApplicationStatus.destroyForJUnitTests(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * Test of {@link HttpNegotiateAuthenticator#getNextAuthToken} | 110 * Test of {@link HttpNegotiateAuthenticator#getNextAuthToken} |
| 111 */ | 111 */ |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 private HttpNegotiateAuthenticator createWithoutNative(String accountType) { | 453 private HttpNegotiateAuthenticator createWithoutNative(String accountType) { |
| 454 HttpNegotiateAuthenticator authenticator = | 454 HttpNegotiateAuthenticator authenticator = |
| 455 spy(HttpNegotiateAuthenticator.create(accountType)); | 455 spy(HttpNegotiateAuthenticator.create(accountType)); |
| 456 doNothing().when(authenticator).nativeSetResult(anyLong(), anyInt(), any
String()); | 456 doNothing().when(authenticator).nativeSetResult(anyLong(), anyInt(), any
String()); |
| 457 doReturn(false) | 457 doReturn(false) |
| 458 .when(authenticator) | 458 .when(authenticator) |
| 459 .lacksPermission(any(Context.class), anyString(), anyBoolean()); | 459 .lacksPermission(any(Context.class), anyString(), anyBoolean()); |
| 460 return authenticator; | 460 return authenticator; |
| 461 } | 461 } |
| 462 } | 462 } |
| OLD | NEW |