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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java

Issue 230673004: Adds unit tests for AwContentsClientCallbackHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos and test names Created 6 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java
index 1ea8a6d8f9590fc54cf728a91974d8e5a58e46f5..96cf269873076ea5a4dfb53ee10a06ff7881fcf8 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java
@@ -8,8 +8,8 @@ import android.test.suitebuilder.annotation.SmallTest;
import android.util.Pair;
import org.chromium.android_webview.AwContents;
+import org.chromium.android_webview.test.TestAwContentsClient.OnReceivedLoginRequestHelper;
import org.chromium.base.test.util.Feature;
-import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.net.test.util.TestWebServer;
import java.util.ArrayList;
@@ -19,53 +19,6 @@ import java.util.List;
* Tests for the AwContentsClient.onReceivedLoginRequest callback.
*/
public class AwContentsClientAutoLoginTest extends AwTestBase {
- public static class OnReceivedLoginRequestHelper extends CallbackHelper {
- String mRealm;
- String mAccount;
- String mArgs;
-
- public String getRealm() {
- assert getCallCount() > 0;
- return mRealm;
- }
-
- public String getAccount() {
- assert getCallCount() > 0;
- return mAccount;
- }
-
- public String getArgs() {
- assert getCallCount() > 0;
- return mArgs;
- }
-
- public void notifyCalled(String realm, String account, String args) {
- mRealm = realm;
- mAccount = account;
- mArgs = args;
- notifyCalled();
- }
- }
-
- private static class TestAwContentsClient
- extends org.chromium.android_webview.test.TestAwContentsClient {
-
- private OnReceivedLoginRequestHelper mOnReceivedLoginRequestHelper;
-
- public TestAwContentsClient() {
- mOnReceivedLoginRequestHelper = new OnReceivedLoginRequestHelper();
- }
-
- public OnReceivedLoginRequestHelper getOnReceivedLoginRequestHelper() {
- return mOnReceivedLoginRequestHelper;
- }
-
- @Override
- public void onReceivedLoginRequest(String realm, String account, String args) {
- getOnReceivedLoginRequestHelper().notifyCalled(realm, account, args);
- }
- }
-
private TestAwContentsClient mContentsClient = new TestAwContentsClient();
private void autoLoginTestHelper(final String testName, final String xAutoLoginHeader,

Powered by Google App Engine
This is Rietveld 408576698