| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.android_webview.test; | 5 package org.chromium.android_webview.test; |
| 6 | 6 |
| 7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
| 8 import android.graphics.Color; | 8 import android.graphics.Color; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.support.test.filters.SmallTest; |
| 10 import android.view.View; | 10 import android.view.View; |
| 11 | 11 |
| 12 import org.chromium.android_webview.AwContents; | 12 import org.chromium.android_webview.AwContents; |
| 13 import org.chromium.android_webview.AwContents.VisualStateCallback; | 13 import org.chromium.android_webview.AwContents.VisualStateCallback; |
| 14 import org.chromium.android_webview.test.util.GraphicsTestUtils; | 14 import org.chromium.android_webview.test.util.GraphicsTestUtils; |
| 15 import org.chromium.base.ThreadUtils; | 15 import org.chromium.base.ThreadUtils; |
| 16 import org.chromium.base.test.util.Feature; | 16 import org.chromium.base.test.util.Feature; |
| 17 | 17 |
| 18 import java.util.concurrent.Callable; | 18 import java.util.concurrent.Callable; |
| 19 import java.util.concurrent.CountDownLatch; | 19 import java.util.concurrent.CountDownLatch; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // VisualStateCallback#onComplete won't be called when WebView is | 157 // VisualStateCallback#onComplete won't be called when WebView is |
| 158 // invisible. So there is no reliable way to tell if View#setVisibility | 158 // invisible. So there is no reliable way to tell if View#setVisibility |
| 159 // has taken effect. Just sleep the test thread for 500ms. | 159 // has taken effect. Just sleep the test thread for 500ms. |
| 160 Thread.sleep(500); | 160 Thread.sleep(500); |
| 161 invisibleBitmap = GraphicsTestUtils.drawAwContentsOnUiThread(mAwContents
, width, height); | 161 invisibleBitmap = GraphicsTestUtils.drawAwContentsOnUiThread(mAwContents
, width, height); |
| 162 assertNotNull(invisibleBitmap); | 162 assertNotNull(invisibleBitmap); |
| 163 assertTrue(invisibleBitmap.sameAs(visibleBitmap)); | 163 assertTrue(invisibleBitmap.sameAs(visibleBitmap)); |
| 164 } | 164 } |
| 165 } | 165 } |
| OLD | NEW |