summaryrefslogtreecommitdiff
path: root/chromium/weblayer/public/javatestutil
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/weblayer/public/javatestutil')
-rw-r--r--chromium/weblayer/public/javatestutil/BUILD.gn1
-rw-r--r--chromium/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java39
2 files changed, 40 insertions, 0 deletions
diff --git a/chromium/weblayer/public/javatestutil/BUILD.gn b/chromium/weblayer/public/javatestutil/BUILD.gn
index 48b69a71639..5fd626da668 100644
--- a/chromium/weblayer/public/javatestutil/BUILD.gn
+++ b/chromium/weblayer/public/javatestutil/BUILD.gn
@@ -12,6 +12,7 @@ android_library("test_java") {
deps = [
"//base:base_java_test_support",
"//third_party/junit:junit",
+ "//weblayer/browser/java:interfaces_java",
"//weblayer/browser/java:test_java",
"//weblayer/public/java",
]
diff --git a/chromium/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java b/chromium/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java
index 370103f4fab..1623a9e7906 100644
--- a/chromium/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java
+++ b/chromium/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java
@@ -9,10 +9,12 @@ import android.content.pm.PackageManager;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.AndroidRuntimeException;
+import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import org.chromium.weblayer_private.interfaces.ObjectWrapper;
import org.chromium.weblayer_private.test_interfaces.ITestWebLayer;
/**
@@ -75,4 +77,41 @@ public final class TestWebLayer {
public void setSystemLocationSettingEnabled(boolean enabled) throws RemoteException {
mITestWebLayer.setSystemLocationSettingEnabled(enabled);
}
+
+ // Runs |runnable| when cc::RenderFrameMetadata's |top_controls_height| and
+ // |bottom_controls_height| matches the supplied values. |runnable| may be run synchronously.
+ public void waitForBrowserControlsMetadataState(Tab tab, int top, int bottom, Runnable runnable)
+ throws RemoteException {
+ mITestWebLayer.waitForBrowserControlsMetadataState(
+ tab.getITab(), top, bottom, ObjectWrapper.wrap(runnable));
+ }
+
+ public void setAccessibilityEnabled(boolean enabled) throws RemoteException {
+ mITestWebLayer.setAccessibilityEnabled(enabled);
+ }
+
+ public boolean canBrowserControlsScroll(Tab tab) throws RemoteException {
+ return mITestWebLayer.canBrowserControlsScroll(tab.getITab());
+ }
+
+ public void addInfoBar(Tab tab, Runnable runnable) throws RemoteException {
+ mITestWebLayer.addInfoBar(tab.getITab(), ObjectWrapper.wrap(runnable));
+ }
+
+ public View getInfoBarContainerView(Tab tab) throws RemoteException {
+ return (View) ObjectWrapper.unwrap(
+ mITestWebLayer.getInfoBarContainerView(tab.getITab()), View.class);
+ }
+
+ public void setIgnoreMissingKeyForTranslateManager(boolean ignore) throws RemoteException {
+ mITestWebLayer.setIgnoreMissingKeyForTranslateManager(ignore);
+ }
+
+ public void forceNetworkConnectivityState(boolean networkAvailable) throws RemoteException {
+ mITestWebLayer.forceNetworkConnectivityState(networkAvailable);
+ }
+
+ public boolean canInfoBarContainerScroll(Tab tab) throws RemoteException {
+ return mITestWebLayer.canInfoBarContainerScroll(tab.getITab());
+ }
}