Commit 4c0f09c9 authored by Yi Xu's avatar Yi Xu Committed by Commit Bot

Update size.attributes.parse.* to reflect spec better

In some size.attributes.parse.* tests, we try to test the enforce
incorrect integer conversion: ex: enforce "#?!" to integer in
size.attributes.parse.junk. In this cl, I update the expectation to
throw type error.

Bug: 1067639

Change-Id: I9573187de770a6beb2a5aeccea589e0e7440f1d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144447Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Yi Xu <yiyix@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758923}
parent 1ca0b7a3
This is a testharness.js-based test.
FAIL Parsing of non-negative integers Failed to set the 'width' property on 'OffscreenCanvas': Value is not of type 'unsigned long'.
Harness: the test ran to completion.
......@@ -20,10 +20,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '100em';
offscreenCanvas.height = '100em';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 100, "offscreenCanvas.height", "100");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '100em'; });
t.done();
});
......
......@@ -16,10 +16,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '100em';
offscreenCanvas.height = '100em';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 100, "offscreenCanvas.height", "100");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '100em'; });
t.done();
});
......
This is a testharness.js-based test.
FAIL Parsing of non-negative integers Failed to set the 'width' property on 'OffscreenCanvas': Value is not of type 'unsigned long'.
Harness: the test ran to completion.
......@@ -20,10 +20,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '#!?';
offscreenCanvas.height = '#!?';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 50, "offscreenCanvas.height", "50");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '#!?'; });
t.done();
});
......
......@@ -16,10 +16,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '#!?';
offscreenCanvas.height = '#!?';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 50, "offscreenCanvas.height", "50");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '#!?'; });
t.done();
});
......
This is a testharness.js-based test.
FAIL Parsing of non-negative integers Failed to set the 'width' property on 'OffscreenCanvas': Value is outside the 'unsigned long' value range.
Harness: the test ran to completion.
......@@ -20,10 +20,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '-100';
offscreenCanvas.height = '-100';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 50, "offscreenCanvas.height", "50");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '-100'; });
t.done();
});
......
......@@ -16,10 +16,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '-100';
offscreenCanvas.height = '-100';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 50, "offscreenCanvas.height", "50");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '-100'; });
t.done();
});
......
This is a testharness.js-based test.
FAIL Parsing of non-negative integers Failed to set the 'width' property on 'OffscreenCanvas': Value is not of type 'unsigned long'.
Harness: the test ran to completion.
......@@ -20,10 +20,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '100%';
offscreenCanvas.height = '100%';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 100, "offscreenCanvas.height", "100");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '100%'; });
t.done();
});
......
......@@ -16,10 +16,7 @@ t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
offscreenCanvas.width = '100%';
offscreenCanvas.height = '100%';
_assertSame(offscreenCanvas.width, 100, "offscreenCanvas.width", "100");
_assertSame(offscreenCanvas.height, 100, "offscreenCanvas.height", "100");
assert_throws_js(TypeError, function() { offscreenCanvas.width = '100%'; });
t.done();
});
......
......@@ -9783,14 +9783,14 @@
("space", " 100", 100),
("whitespace", "\t\f100", 100),
("plus", "+100", 100),
("minus", "-100", None),
("minus", "-100", "exception"),
("octal", "0100", 100),
("hex", "0x100", 0x100),
("exp", "100e1", 100e1),
("decimal", "100.999", 100),
("percent", "100%", 100),
("em", "100em", 100),
("junk", "#!?", None),
("percent", "100%", "exception"),
("em", "100em", "exception"),
("junk", "#!?", "exception"),
("trailingjunk", "100#!?", "exception"),
]
def gen(name, string, exp, code):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment