Skip to content

Commit

Permalink
[geometry] Test structured serialization for 2d matrix with m13=-0
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed May 18, 2017
1 parent 3f89f64 commit e366844
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions css/geometry-1/structured-serialization.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,36 @@
case "DOMMatrix":
promise_test(t => {
const object = new self[constr]([1, -0, Infinity, NaN, 5, 6]);
object.m13 = -0;
object.m14 = -0;
object.m23 = -0;
object.m24 = -0;
object.m31 = -0;
object.m32 = -0;
object.m34 = -0;
object.m43 = -0;
assert_true(object.is2D, 'is2D after setting m13 etc to -0');
return clone(object).then(other => {
for (let attr of attrs) {
assert_equals(other[attr], object[attr], attr);
if (attr === 'm13' ||
attr === 'm14' ||
attr === 'm23' ||
attr === 'm24' ||
attr === 'm31' ||
attr === 'm32' ||
attr === 'm34' ||
attr === 'm43') {
assert_equals(other[attr], 0, attr);
} else {
assert_equals(other[attr], object[attr], attr);
}
}
t.done();
});
}, `${prefix} non-initial values (2d)`);

promise_test(t => {
const object = new self[constr]([11, 12, 13, 14,
const object = new self[constr]([11, -0, Infinity, NaN,
21, 22, 23, 24,
31, 32, 33, 34,
41, 42, 43, 44]);
Expand Down

0 comments on commit e366844

Please sign in to comment.