Fix testGetContentHeight for low density case

With android:layout_height set to |match_parent|, WebView#getContentHeight() will give the screen's height instead of real web page height if the real web page is shorter than the scree height, this will cause the |extraSpace| to be a wrong value.

When device scale factor is less than 1.0f, i.e. density less than 160, |pageHeight| in this test is smaller than the real device's height, so the web page couldn't fill the screen.

This CL makes the |pageHeight| larger than the screen's height by scaling up a factor 1.0f / scale, when scale is less than 1.0f.

Bug: 133724959
Test: cts-tradefed run cts -m CtsWebkitTestCases -t android.webkit.cts.WebViewTest#testGetContentHeight pass.

Change-Id: Ifa8211a6b0f8818f8b1df2c27765fbe617218b46
1 file changed