2015-07-30 21:45:00 +03:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<title>Test ImageBitmap : StructuredClone main window to main window</title>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
|
|
|
<body>
|
2016-01-26 05:53:46 +03:00
|
|
|
<script src="imagebitmap_structuredclone_utils.js"></script>
|
2015-07-30 21:45:00 +03:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
window.onmessage = function(event) {
|
|
|
|
compareImageBitmapWithImageElement(event.data.bitmap1, gImage1);
|
|
|
|
compareImageBitmapWithImageElement(event.data.bitmap2, gImage2);
|
2016-01-26 06:27:23 +03:00
|
|
|
compareImageBitmapWithImageData(event.data.bitmap3, gImageData, "Check preserving alpha");
|
2015-07-30 21:45:00 +03:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
function runTests() {
|
2016-01-26 05:53:46 +03:00
|
|
|
prepareImageBitmaps().then(function(){
|
2016-01-26 06:27:23 +03:00
|
|
|
window.postMessage({"bitmap1":gImageBitmap1, "bitmap2":gImageBitmap2, "bitmap3":gImageBitmap3}, "*");
|
2015-07-30 21:45:00 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
addLoadEvent(runTests);
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|