OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
8 | 8 |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.Color; | 10 import android.graphics.Color; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 public void onFinishGetBitmap(Bitmap bitmap) { | 108 public void onFinishGetBitmap(Bitmap bitmap) { |
109 assertNotNull("Readback did not return valid bitmap", bi
tmap); | 109 assertNotNull("Readback did not return valid bitmap", bi
tmap); |
110 // Verify a pixel in the center of the screenshot. | 110 // Verify a pixel in the center of the screenshot. |
111 color.set(bitmap.getPixel(bitmap.getWidth() / 2, bitmap.
getHeight() / 2)); | 111 color.set(bitmap.getPixel(bitmap.getWidth() / 2, bitmap.
getHeight() / 2)); |
112 readbackDone.set(true); | 112 readbackDone.set(true); |
113 } | 113 } |
114 }; | 114 }; |
115 | 115 |
116 contentReadbackHandler.initNativeContentReadbackHandler(); | 116 contentReadbackHandler.initNativeContentReadbackHandler(); |
117 contentReadbackHandler.getContentBitmapAsync(1.0f, new Rect(), g
etContentViewCore(), | 117 contentReadbackHandler.getContentBitmapAsync(1.0f, new Rect(), g
etContentViewCore(), |
118 callback); | 118 Bitmap.Config.ARGB_8888, callback); |
119 } | 119 } |
120 }); | 120 }); |
121 assertWaitForReadback(readbackDone); | 121 assertWaitForReadback(readbackDone); |
122 | 122 |
123 assertEqualColor(color.get(), Color.BLUE, COLOR_THRESHOLD); | 123 assertEqualColor(color.get(), Color.BLUE, COLOR_THRESHOLD); |
124 } | 124 } |
125 } | 125 } |
OLD | NEW |