Bug 1336351 - Add web platform test. r=smaug

This commit is contained in:
vincentliu 2017-02-14 11:41:17 +08:00
Родитель fda0c3a079
Коммит 86bab080c6
2 изменённых файлов: 43 добавлений и 0 удалений

Просмотреть файл

@ -92055,6 +92055,12 @@
{}
]
],
"html/semantics/embedded-content/the-canvas-element/toBlob.null.html": [
[
"/html/semantics/embedded-content/the-canvas-element/toBlob.null.html",
{}
]
],
"html/semantics/embedded-content/the-canvas-element/toBlob.png.html": [
[
"/html/semantics/embedded-content/the-canvas-element/toBlob.png.html",
@ -174480,6 +174486,10 @@
"d7e7c17c306c8e7dd60e2199255b20d6bc871f6e",
"testharness"
],
"html/semantics/embedded-content/the-canvas-element/toBlob.null.html": [
"79b4a278f0e35646cfdffeebf8f0523e2772bc9b",
"testharness"
],
"html/semantics/embedded-content/the-canvas-element/toBlob.png.html": [
"bfd114af336758effac1c29d202abd0775ab5b2e",
"testharness"

Просмотреть файл

@ -0,0 +1,33 @@
<!doctype html>
<meta charset=utf-8>
<title>Canvas test: toBlob.null</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>toBlob.null</h1>
<p class="desc">toBlob with zero dimension returns a null Blob</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
async_test(function() {
on_event(window, "load", this.step_func(function() {
var toBlobCalled = false;
c.toBlob(this.step_func(function(blob) {
toBlobCalled = true;
_assertSame(blob, null, "blob", "null");
c.width = 0;
c.height = 100;
c.toBlob(this.step_func_done(function(blob) {
_assertSame(blob, null, "blob", "null");
}), 'image/jpeg');
}), 'image/jpeg');
assert_false(toBlobCalled, "toBlob callback shouldn't be called synchronously");
}));
}, "toBlob with zero dimension returns a null Blob");
</script>