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

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

Issue 2694273002: Revert of Refactor ContentViewClient (4/6) (Closed)
Patch Set: Created 3 years, 10 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/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewClient.java
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewClient.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewClient.java
new file mode 100644
index 0000000000000000000000000000000000000000..7fda5207bd8baeff29a7aef1584c7a758b47fe9c
--- /dev/null
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewClient.java
@@ -0,0 +1,41 @@
+// Copyright 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.test.util;
+
+import android.content.Context;
+
+import org.chromium.content.browser.ContentViewClient;
+import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnStartContentIntentHelper;
+
+/**
+ * The default ContentViewClient used by ContentView tests.
+ * <p>
+ * Tests that need to supply their own ContentViewClient should do that
+ * by extending this one.
+ */
+public class TestContentViewClient extends ContentViewClient {
+
+ private final OnStartContentIntentHelper mOnStartContentIntentHelper;
+
+ public TestContentViewClient() {
+ mOnStartContentIntentHelper = new OnStartContentIntentHelper();
+ }
+
+ public OnStartContentIntentHelper getOnStartContentIntentHelper() {
+ return mOnStartContentIntentHelper;
+ }
+
+ /**
+ * ATTENTION!: When overriding the following method, be sure to call
+ * the corresponding method in the super class. Otherwise
+ * {@link CallbackHelper#waitForCallback()} methods will
+ * stop working!
+ */
+
+ @Override
+ public void onStartContentIntent(Context context, String contentUrl, boolean isMainFrame) {
+ mOnStartContentIntentHelper.notifyCalled(contentUrl);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698