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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/util/TestCallbackHelperContainer.java

Issue 10979009: Move content test utils to content/public/test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on new branch Created 8 years, 3 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: content/public/android/javatests/src/org/chromium/content/browser/util/TestCallbackHelperContainer.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/util/TestCallbackHelperContainer.java b/content/public/android/javatests/src/org/chromium/content/browser/util/TestCallbackHelperContainer.java
deleted file mode 100644
index 43d2193291ba8ba268b2ab2f1fe9889c198e4ea5..0000000000000000000000000000000000000000
--- a/content/public/android/javatests/src/org/chromium/content/browser/util/TestCallbackHelperContainer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content.browser.util;
-
-
-import org.chromium.content.browser.ContentView;
-
-/**
- * This class is used to provide callback hooks for tests and related classes.
- */
-public class TestCallbackHelperContainer{
- private TestContentViewClient mTestContentViewClient;
- private TestWebContentsObserver mTestWebContentsObserver;
-
- public TestCallbackHelperContainer(ContentView contentView) {
- mTestContentViewClient = new TestContentViewClient();
- contentView.getContentViewCore().setContentViewClient(mTestContentViewClient);
- mTestWebContentsObserver = new TestWebContentsObserver(contentView.getContentViewCore());
- }
-
- public static class OnPageFinishedHelper extends CallbackHelper {
- private String mUrl;
- public void notifyCalled(String url) {
- mUrl = url;
- notifyCalled();
- }
- public String getUrl() {
- assert getCallCount() > 0;
- return mUrl;
- }
- }
-
- public static class OnPageStartedHelper extends CallbackHelper {
- private String mUrl;
- public void notifyCalled(String url) {
- mUrl = url;
- notifyCalled();
- }
- public String getUrl() {
- assert getCallCount() > 0;
- return mUrl;
- }
- }
-
- public static class OnReceivedErrorHelper extends CallbackHelper {
- private int mErrorCode;
- private String mDescription;
- private String mFailingUrl;
- public void notifyCalled(int errorCode, String description, String failingUrl) {
- mErrorCode = errorCode;
- mDescription = description;
- mFailingUrl = failingUrl;
- notifyCalled();
- }
- public int getErrorCode() {
- assert getCallCount() > 0;
- return mErrorCode;
- }
- public String getDescription() {
- assert getCallCount() > 0;
- return mDescription;
- }
- public String getFailingUrl() {
- assert getCallCount() > 0;
- return mFailingUrl;
- }
- }
-
- public static class OnEvaluateJavaScriptResultHelper extends CallbackHelper {
- private int mId;
- private String mJsonResult;
- public void notifyCalled(int id, String jsonResult) {
- mId = id;
- mJsonResult = jsonResult;
- notifyCalled();
- }
- public int getId() {
- assert getCallCount() > 0;
- return mId;
- }
- public String getJsonResult() {
- assert getCallCount() > 0;
- return mJsonResult;
- }
- }
-
- public OnPageStartedHelper getOnPageStartedHelper() {
- return mTestWebContentsObserver.getOnPageStartedHelper();
- }
-
- public OnPageFinishedHelper getOnPageFinishedHelper() {
- return mTestWebContentsObserver.getOnPageFinishedHelper();
- }
-
- public OnReceivedErrorHelper getOnReceivedErrorHelper() {
- return mTestWebContentsObserver.getOnReceivedErrorHelper();
- }
-
- public OnEvaluateJavaScriptResultHelper getOnEvaluateJavaScriptResultHelper() {
- return mTestContentViewClient.getOnEvaluateJavaScriptResultHelper();
- }
-}

Powered by Google App Engine
This is Rietveld 408576698