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

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

Issue 2090633002: Improving test coverage of Popup Zoomer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java
index 4d31c2bb5c408b0b4ab05cd30c378eec58d596ec..7dfcf8818829bb60d3a7215de4127a269b337902 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java
@@ -5,6 +5,7 @@
package org.chromium.content.browser;
import android.test.suitebuilder.annotation.MediumTest;
+import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -17,6 +18,9 @@ import org.chromium.content_shell_apk.ContentShellTestBase;
import java.util.concurrent.TimeoutException;
+/**
+ * Class which provides test coverage for Popup Zoomer.
+ */
public class ContentViewPopupZoomerTest extends ContentShellTestBase {
private static PopupZoomer findPopupZoomer(ViewGroup view) {
assert view != null;
@@ -98,4 +102,24 @@ public class ContentViewPopupZoomerTest extends ContentShellTestBase {
// The shown popup should have valid dimensions eventually.
CriteriaHelper.pollInstrumentationThread(new PopupHasNonZeroDimensionsCriteria(view));
}
+
+ /**
+ * Tests Popup zoomer hides when device back key is pressed.
+ */
+ @MediumTest
+ @Feature({"Browser"})
+ public void testBackKeyDismissesPopupZoomer() throws InterruptedException, TimeoutException {
+ launchContentShellWithUrl(generateTestUrl(100, 15, "clickme"));
+ waitForActiveShellToBeDoneLoading();
+
+ final ContentViewCore viewCore = getContentViewCore();
+ final ViewGroup view = viewCore.getContainerView();
+
+ CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria(view, false));
+ DOMUtils.clickNode(this, viewCore, "clickme");
+ CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria(view, true));
+ sendKeys(KeyEvent.KEYCODE_BACK);
+ // When device key is pressed, popup zoomer should hide if already showing.
+ CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria(view, false));
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698