Chromium Code Reviews| Index: LayoutTests/compositing/copy-image-when-no-image-exists.html |
| diff --git a/LayoutTests/compositing/copy-image-when-no-image-exists.html b/LayoutTests/compositing/copy-image-when-no-image-exists.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..56cd6bb460c04398b66c525575997e141f32385b |
| --- /dev/null |
| +++ b/LayoutTests/compositing/copy-image-when-no-image-exists.html |
| @@ -0,0 +1,49 @@ |
| +<!-- This test checks copyImageAt() with position parameter |
| + that actually doesn't point to an Image(Canvas). |
| + (Negative test for crbug.com/392765) --> |
| +<head> |
| +<script src="../resources/js-test.js"></script> |
| +<script> |
| + |
| +function main() |
| +{ |
| + if (!window.testRunner) { |
| + testFailed("Requires window.testRunner"); |
| + } else { |
| + testRunner.waitUntilDone(); |
| + testRunner.dumpAsText(); |
| + window.requestAnimationFrame(runTest); |
| + } |
| +} |
| + |
| +function runTest() { |
| + try { |
| + testRunner.copyImageAtAndCapturePixelsAsyncThen(50, 50, completionCallback); |
| + } catch (e) { |
| + debug('error in runTest'); |
| + debug(e); |
| + testRunner.notifyDone(); |
| + } |
| +} |
| +var width, height; |
| +function completionCallback(w, h, snapshot) { |
| + try { |
| + width = w; |
| + height = h; |
| + shouldBeEqualToNumber("width", 0); |
| + shouldBeEqualToNumber("height", 0); |
|
Ken Russell (switch to Gerrit)
2014/07/18 23:33:29
Ideally this would test the value of "snapshot", t
|
| + } catch (e) { |
| + debug('error in completionCallback'); |
| + debug(e); |
| + testRunner.notifyDone(); |
| + return; |
| + } |
| + testRunner.notifyDone(); |
| +} |
| + |
| +main(); |
| +</script> |
| +</head> |
| +<body> |
| +<div id="console"></div> |
| +</body> |