diff options
author | Daniel Xie <dxie@google.com> | 2016-01-12 18:28:11 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-01-12 18:28:11 +0000 |
commit | 69a98ee633a728767d68304bb77db871421cbff9 (patch) | |
tree | c273eacdc89b06d99198211a1ed02d6a88c796aa /libs | |
parent | 0cbbf6421656ae1116fbc24d2fbaf6dc36e65a08 (diff) | |
parent | a2e58413d5aa99c5c654bad077913c12c1d04668 (diff) | |
download | platform_cts-69a98ee633a728767d68304bb77db871421cbff9.tar.gz platform_cts-69a98ee633a728767d68304bb77db871421cbff9.tar.bz2 platform_cts-69a98ee633a728767d68304bb77db871421cbff9.zip |
Merge "Fix layout for WebViewTest#testRequestChildRectangleOnScreen" into lollipop-mr1-cts-dev
am: a2e58413d5
* commit 'a2e58413d5aa99c5c654bad077913c12c1d04668':
Fix layout for WebViewTest#testRequestChildRectangleOnScreen
Diffstat (limited to 'libs')
-rw-r--r-- | libs/deviceutillegacy/src/android/webkit/cts/WebViewOnUiThread.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/deviceutillegacy/src/android/webkit/cts/WebViewOnUiThread.java b/libs/deviceutillegacy/src/android/webkit/cts/WebViewOnUiThread.java index 2933b0b0f9a..b9ee9878c03 100644 --- a/libs/deviceutillegacy/src/android/webkit/cts/WebViewOnUiThread.java +++ b/libs/deviceutillegacy/src/android/webkit/cts/WebViewOnUiThread.java @@ -807,6 +807,17 @@ public class WebViewOnUiThread { }); } + public void setLayoutToMatchParent() { + runOnUiThread(new Runnable() { + @Override + public void run() { + setMatchParent((View) mWebView.getParent()); + setMatchParent(mWebView); + mWebView.requestLayout(); + } + }); + } + public void setAcceptThirdPartyCookies(final boolean accept) { runOnUiThread(new Runnable() { @Override @@ -978,6 +989,18 @@ public class WebViewOnUiThread { } /** + * Set LayoutParams to MATCH_PARENT. + * + * @param view Target view + */ + private void setMatchParent(View view) { + ViewGroup.LayoutParams params = view.getLayoutParams(); + params.height = ViewGroup.LayoutParams.MATCH_PARENT; + params.width = ViewGroup.LayoutParams.MATCH_PARENT; + view.setLayoutParams(params); + } + + /** * A WebChromeClient used to capture the onProgressChanged for use * in waitFor functions. If a test must override the WebChromeClient, * it can derive from this class or call onProgressChanged |