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

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

Issue 23572016: [Android WebView] Wire up the viewport quirks settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split into 2 quirks, as per the final version of Blink's http://crrev.com/23691017 Created 7 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: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
index 29906b5224a934687a1f3cc58692adfd01a22ab8..c0f6387693aafafc62d5b9525364c00907348d8b 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
@@ -328,4 +328,28 @@ public class AwTestBase
}
});
}
+
+ /**
+ * Returns pure page scale.
+ */
+ protected float getScaleOnUiThread(final AwContents awContents) throws Exception {
+ return runTestOnUiThreadAndGetResult(new Callable<Float>() {
+ @Override
+ public Float call() throws Exception {
+ return awContents.getContentViewCore().getScale();
+ }
+ });
+ }
+
+ /**
+ * Returns page scale multiplied by the screen density.
+ */
+ protected float getPixelScaleOnUiThread(final AwContents awContents) throws Throwable {
+ return runTestOnUiThreadAndGetResult(new Callable<Float>() {
+ @Override
+ public Float call() throws Exception {
+ return awContents.getScale();
+ }
+ });
+ }
}

Powered by Google App Engine
This is Rietveld 408576698