Commit 18a81835 authored by Chris Nardi's avatar Chris Nardi Committed by Commit Bot

Add expected exceptions to assert_throws statements

Some assert_throws statements did not include expected exceptions, which
broke their respective tests following a testharness.js update. Add
expected exceptions for all assert_throws statements. The only
functional change was to fast/serviceworker/serviceworker-interface.html
as per the spec ServiceWorker extends EventTarget and not Worker.

Bug: 754365
Change-Id: I733605d721085788d43e179ca6f9a7c7b25da995
Reviewed-on: https://chromium-review.googlesource.com/1056253Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Chris Nardi <cnardi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558476}
parent ea78046d
This is a testharness.js-based test.
PASS Standard array of numbers.
PASS Standard set of numbers.
PASS Standard empty array.
PASS Standard empty set.
PASS Custom list of numbers.
PASS Truthy done signal.
PASS Custom list of numbers with missing "done: false" signal.
PASS Terminates when done is true.
PASS Empty list.
PASS Non-iterable object.
FAIL Iterator object without next() function should throw. Test bug: need to pass exception to assert_throws()
FAIL Non-object iterator.next() result should throw. Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -58,8 +58,8 @@ assertIterationJoinEqual({}, 'Non-iterable object.');
test(() => {
var iterable = {[Symbol.iterator]() { return {}; }};
assert_throws(null, () => Array.from(iterable));
assert_throws(null, () => internals.dictionaryTest().stringFromIterable(iterable));
assert_throws(new TypeError, () => Array.from(iterable));
assert_throws(new TypeError, () => internals.dictionaryTest().stringFromIterable(iterable));
}, 'Iterator object without next() function should throw.');
test(() => {
......@@ -69,7 +69,7 @@ test(() => {
{done: false, value: 3},
1234,
]);
assert_throws(null, () => Array.from(iterable));
assert_throws(null, () => internals.dictionaryTest().stringFromIterable(iterable));
assert_throws(new TypeError, () => Array.from(iterable));
assert_throws(new TypeError, () => internals.dictionaryTest().stringFromIterable(iterable));
}, 'Non-object iterator.next() result should throw.');
</script>
This is a testharness.js-based test.
FAIL BluetoothGATTRemoteServer IDL test Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -3,9 +3,9 @@
<script src="../../resources/testharnessreport.js"></script>
<script>
test(() => {
assert_throws(null, () => new BluetoothGATTRemoteServer(),
assert_throws(new ReferenceError, () => new BluetoothGATTRemoteServer(),
'the constructor should not be callable with "new"');
assert_throws(null, () => BluetoothGATTRemoteServer(),
assert_throws(new ReferenceError, () => BluetoothGATTRemoteServer(),
'the constructor should not be callable');
}, 'BluetoothGATTRemoteServer IDL test');
</script>
This is a testharness.js-based test.
FAIL context is destroyed; call across context Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -22,7 +22,7 @@ if (fork()) {
return watcher.wait_for('message');
})).then(t.step_func((event) => {
assert_equals(event.data, 'PASS child done');
assert_throws(null, () => new window.C());
assert_throws(new Error, () => new window.C());
t.done();
}));
} else {
......
This is a testharness.js-based test.
FAIL Overlapping old and new-style custom elements are not allowed Test bug: need to pass exception to assert_throws()
PASS V0 and V1 definition and createElement cannot be used together
Harness: the test ran to completion.
......@@ -10,7 +10,7 @@ test_with_window((w) => {
class X extends w.HTMLElement {}
w.customElements.define('new-old', X);
assert_throws(null, () => {
assert_throws("NotSupportedError", () => {
w.document.registerElement('new-old', {prototype: X.prototype});
}, '"registering" (v0) a name already "defined" should throw');
......@@ -18,7 +18,7 @@ test_with_window((w) => {
prototype: Object.create(w.HTMLElement.prototype)
});
class Y extends w.HTMLElement {}
assert_throws(null, () => {
assert_throws("NotSupportedError", () => {
w.customElements.define('old-new', Y);
}, '"defining" (v1) a name already "registered" (v0) should throw');
}, 'Overlapping old and new-style custom elements are not allowed');
......
This is a testharness.js-based test.
PASS PixelTestBasicDrawing 1
PASS PixelTestBasicDrawing 2
PASS PixelTestBasicDrawing 3
PASS PixelTestBasicDrawing 4
PASS PixelTestBasicDrawing 5
PASS PixelTestBasicDrawing 6
PASS PixelTestBasicDrawing 7
PASS PixelTestPositionedDrawing 1
PASS PixelTestPositionedDrawing 2
PASS PixelTestPositionedDrawing 3
PASS PixelTestPositionedDrawing 4
PASS PixelTestPositionedDrawing 5
PASS PixelTestTranslation 1
PASS PixelTestTranslation 2
PASS PixelTestTranslation 3
PASS PixelTestTranslation 4
PASS Test dirty rect handling.
PASS Test drawing outside the canvas border.
PASS test drawing with non-intersecting dirty rect.
PASS Test drawing to region intersect edge of canvas.
PASS PixelTestRegionIntersectLeftEdge 1
PASS PixelTestRegionIntersectLeftEdge 2
PASS PixelTestRegionIntersectLeftEdge 3
PASS PixelTestRegionIntersectRightEdge 1
PASS PixelTestRegionIntersectRightEdge 2
PASS PixelTestRegionIntersectRightEdge 3
PASS PixelTestRegionIntersectTopEdge 1
PASS PixelTestRegionIntersectTopEdge 2
PASS PixelTestRegionIntersectTopEdge 3
PASS PixelTestRegionIntersectBototmEdge 1
PASS PixelTestRegionIntersectBototmEdge 2
PASS PixelTestRegionIntersectBototmEdge 3
PASS Test drawing with only part of the dirty region intersecting the window.
PASS PixelTestDirtyRegionIntersectLeftEdge 1
PASS PixelTestDirtyRegionIntersectLeftEdge 2
PASS PixelTestDirtyRegionIntersectLeftEdge 3
PASS PixelTestDirtyRegionIntersectLeftEdge 4
PASS PixelTestDirtyRegionIntersectLeftEdge 5
PASS PixelTestDirtyRegionIntersectLeftEdge 6
PASS PixelTestDirtyRegionIntersectRightEdge 1
PASS PixelTestDirtyRegionIntersectRightEdge 2
PASS PixelTestDirtyRegionIntersectRightEdge 3
PASS PixelTestDirtyRegionIntersectRightEdge 4
PASS PixelTestDirtyRegionIntersectRightEdge 5
PASS PixelTestDirtyRegionIntersectRightEdge 6
PASS PixelTestDirtyRegionIntersectTopEdge 1
PASS PixelTestDirtyRegionIntersectTopEdge 2
PASS PixelTestDirtyRegionIntersectTopEdge 3
PASS PixelTestDirtyRegionIntersectTopEdge 4
PASS PixelTestDirtyRegionIntersectTopEdge 5
PASS PixelTestDirtyRegionIntersectTopEdge 6
PASS PixelTestDirtyRegionIntersectBottomEdge 1
PASS PixelTestDirtyRegionIntersectBottomEdge 2
PASS PixelTestDirtyRegionIntersectBottomEdge 3
PASS PixelTestDirtyRegionIntersectBottomEdge 4
PASS PixelTestDirtyRegionIntersectBottomEdge 5
PASS PixelTestDirtyRegionIntersectBottomEdge 6
PASS Test clamping of dx/dy.
PASS Test clamping of dirtyX/Y/Width/Height.
FAIL TestInvalidParam 1 Test bug: need to pass exception to assert_throws()
FAIL TestInvalidParam 2 Test bug: need to pass exception to assert_throws()
FAIL TestInvalidParam 3 Test bug: need to pass exception to assert_throws()
PASS Ensure we don't mess up bounds clipping checks.
Harness: the test ran to completion.
......@@ -241,9 +241,9 @@ test(function(t) {
}, "Test clamping of dirtyX/Y/Width/Height.");
var testInvalidParams = [
['TestInvalidParam 1', null, function() {context.putImageData({}, 0, 0);}],
['TestInvalidParam 2', null, function() {context.putImageData(null, 0, 0, 0, 0, 0, 0);}],
['TestInvalidParam 3', null, function() {context.putImageData(undefined, 0, 0, 0, 0, 0, 0);}],
['TestInvalidParam 1', new TypeError, function() {context.putImageData({}, 0, 0);}],
['TestInvalidParam 2', new TypeError, function() {context.putImageData(null, 0, 0, 0, 0, 0, 0);}],
['TestInvalidParam 3', new TypeError, function() {context.putImageData(undefined, 0, 0, 0, 0, 0, 0);}],
];
......
This is a testharness.js-based test.
FAIL Test Window and its prototype chain's constructors. Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -6,19 +6,19 @@ test(() => {
assert_equals(window.constructor.prototype, window.__proto__,
"Window constructor prototype is window prototype.");
assert_throws(null, () => { window.constructor(); },
assert_throws(new TypeError, () => { window.constructor(); },
"Window constructor must be non-callable.");
assert_throws(null, () => { new window.constructor; },
assert_throws(new TypeError, () => { new window.constructor; },
"Window constructor must be non-callable.");
assert_throws(null, () => { window.__proto__.constructor(); },
assert_throws(new TypeError, () => { window.__proto__.constructor(); },
"Window.prototype constructor must be non-callable.");
assert_throws(null, () => { new window.__proto__.constructor; },
assert_throws(new TypeError, () => { new window.__proto__.constructor; },
"Window.prototype constructor must be non-callable.");
assert_throws(null, () => { window.__proto__.__proto__.constructor(); },
assert_throws(new TypeError, () => { window.__proto__.__proto__.constructor(); },
"WindowProperties constructor must be non-callable.");
assert_throws(null, () => { new window.__proto__.__proto__.constructor; },
assert_throws(new TypeError, () => { new window.__proto__.__proto__.constructor; },
"WindowProperties constructor must be non-callable.");
}, "Test Window and its prototype chain's constructors.");
</script>
This is a testharness.js-based test.
FAIL Construct call to window methods throws. Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -3,6 +3,6 @@
<script src="../../../resources/testharnessreport.js"></script>
<script>
test(t => {
assert_throws(null, function() { new window.blur(); });
assert_throws(new TypeError, function() { new window.blur(); });
}, "Construct call to window methods throws.");
</script>
This is a testharness.js-based test.
PASS window.customElements.define is defined
FAIL window.customElements.define requires two arguments Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -8,9 +8,9 @@ test(function () {
}, 'window.customElements.define is defined');
test(function () {
assert_throws(null, function () { window.customElements.define(); },
assert_throws(new TypeError, function () { window.customElements.define(); },
'"define" without arguments should throw TypeError');
assert_throws(null, function () { window.customElements.define("x-x"); },
assert_throws(new TypeError, function () { window.customElements.define("x-x"); },
'"define" with one argument should throw TypeError');
window.customElements.define('x-empty-function', function () { });
......
......@@ -4,7 +4,7 @@ PASS This tests Get function
PASS This tests case sensitive scenario
PASS Tests Undefined
PASS Tests matchesNothingInDataset
FAIL Tests Set Test bug: need to pass exception to assert_throws()
PASS Tests Set
PASS Tests Is Null
PASS Tests Delete
PASS Tests Native Delete
......@@ -14,7 +14,7 @@ PASS This tests Get function
PASS This tests case sensitive scenario
PASS Tests Undefined
PASS Tests matchesNothingInDataset
FAIL Tests Set Test bug: need to pass exception to assert_throws()
PASS Tests Set
PASS Tests Is Null
PASS Tests Delete
PASS Tests Native Delete
......
......@@ -94,9 +94,9 @@ function testDataset(getTestElement) {
assert_true(testSet('2d', 'data-2d'));
assert_true(testSet('d-2', 'data-d-2'));
assert_true(testSet('A--S', 'data--a---s'));
assert_throws(null, function() { testSet('-foo', 'dummy'); }, '"SyntaxError: Failed to set the \'-foo\' property on \'DOMStringMap\': \'-foo\' is not a valid property name."');
assert_throws(null, function() { testSet('foo\x20', 'dummy'); }, '"InvalidCharacterError: Failed to set the \'foo\x20\' property on \'DOMStringMap\': \'data-foo\x20\' is not a valid attribute name."');
assert_throws(null, function() { testSet('foo\uF900', 'dummy'); }, '"InvalidCharacterError: Failed to set the \'foo\uF900\' property on \'DOMStringMap\': \'data-foo\uF900\' is not a valid attribute name."');
assert_throws(new SyntaxError, function() { testSet('-foo', 'dummy'); }, '"SyntaxError: Failed to set the \'-foo\' property on \'DOMStringMap\': \'-foo\' is not a valid property name."');
assert_throws("InvalidCharacterError", function() { testSet('foo\x20', 'dummy'); }, '"InvalidCharacterError: Failed to set the \'foo\x20\' property on \'DOMStringMap\': \'data-foo\x20\' is not a valid attribute name."');
assert_throws("InvalidCharacterError", function() { testSet('foo\uF900', 'dummy'); }, '"InvalidCharacterError: Failed to set the \'foo\uF900\' property on \'DOMStringMap\': \'data-foo\uF900\' is not a valid attribute name."');
},'Tests Set');
......
This is a testharness.js-based test.
FAIL Test [LenientThis] and non-[LenientThis]. Test bug: need to pass exception to assert_throws()
PASS Test with extracted accessors.
Harness: the test ran to completion.
......@@ -12,10 +12,10 @@ test(function() {
// GlobalEventHandlers.onmousedown is NOT [LenientThis].
assert_equals(document.onmousedown, null, "|this| is an appropriate object.");
assert_throws(null, function() {
assert_throws(new TypeError, function() {
Document.prototype.onmousedown;
}, "Document.prototype is invalid as |this|.");
assert_throws(null, function() {
assert_throws(new TypeError, function() {
Document.prototype.onmousedown = 'foo';
}, "Document.prototype is invalid as |this|.");
}, "Test [LenientThis] and non-[LenientThis].");
......
This is a testharness.js-based test.
PASS BlobEvent creation and content management
PASS BlobEvent creation with timecode
FAIL BlobEvent needs two constructor parameters, type and BlobEventInit Test bug: need to pass exception to assert_throws()
FAIL BlobEvent needs the second constructor parameter to be a BlobEventInit Test bug: need to pass exception to assert_throws()
FAIL BlobEventInit needs a data parameter Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -30,14 +30,14 @@ test(function() {
}, 'BlobEvent creation with timecode');
test(function() {
assert_throws(null,
assert_throws(new TypeError,
function() { var blobEvent = new BlobEvent('BlobEvent'); });
}, 'BlobEvent needs two constructor parameters, type and BlobEventInit');
test(function() {
var array = new Uint8Array([0x70, 0x71, 0x72, 0x73]);
var blob = new Blob([array]);
assert_throws(null,
assert_throws(new TypeError,
function() {
var blobEvent = new BlobEvent(blob, {data : "blergh"});
});
......@@ -46,7 +46,7 @@ test(function() {
test(function() {
var array = new Uint8Array([0x70, 0x71, 0x72, 0x73]);
var blob = new Blob([array]);
assert_throws(null,
assert_throws(new TypeError,
function() {
var blobEvent = new BlobEvent(blob, {timecode : 0.0});
});
......
This is a testharness.js-based test.
FAIL ServiceWorker interface Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -5,12 +5,12 @@
test(function() {
assert_true('ServiceWorker' in window,
'the constructor should be defined');
assert_throws(null, function() { new ServiceWorker(); },
assert_throws(new TypeError, function() { new ServiceWorker(); },
'the constructor should not be callable with "new"');
assert_throws(null, function() { ServiceWorker(); },
assert_throws(new TypeError, function() { ServiceWorker(); },
'the constructor should not be callable');
assert_equals(Object.getPrototypeOf(ServiceWorker.prototype),
Worker.prototype,
'ServiceWorker should extend Worker');
EventTarget.prototype,
'ServiceWorker should extend EventTarget');
}, 'ServiceWorker interface');
</script>
This is a testharness.js-based test.
FAIL ServiceWorkerContainer interface Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -12,9 +12,9 @@ function getPropertyDescriptor(name) {
test(function() {
assert_true('ServiceWorkerContainer' in window,
'the constructor should be defined');
assert_throws(null, function() { new ServiceWorkerContainer(); },
assert_throws(new TypeError, function() { new ServiceWorkerContainer(); },
'the constructor should not be callable with "new"');
assert_throws(null, function() { ServiceWorkerContainer(); },
assert_throws(new TypeError, function() { ServiceWorkerContainer(); },
'the constructor should not be callable');
}, 'ServiceWorkerContainer interface');
</script>
This is a testharness.js-based test.
FAIL Checks the properties exposed on the Notification object. Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -48,7 +48,7 @@
assert_array_equals(notification.actions, options.actions);
// The `actions` field should be immutable.
assert_throws(null, () => notification.actions.push(null));
assert_throws(new TypeError, () => notification.actions.push(null));
notification.actions.foo = 'bar';
assert_false(notification.actions.hasOwnProperty('foo'));
......@@ -106,7 +106,7 @@
assert_array_equals(vibrateNotification.vibrate, [1000]);
// The `vibrate` property should be immutable.
assert_throws(null, () => vibrateNotification.vibrate.push(1000));
assert_throws(new TypeError, () => vibrateNotification.vibrate.push(1000));
vibrateNotification.vibrate[0] = 2000;
assert_equals(vibrateNotification.vibrate[0], 1000);
......
This is a testharness.js-based test.
FAIL Clicking on a notification displayed by a Service Worker the notificationclick event. assert_unreached: unexpected rejection: Test bug: need to pass exception to assert_throws() Reached unreachable code
Harness: the test ran to completion.
......@@ -97,7 +97,7 @@
assert_object_is_superset(notifications[0], options, 'The Notification object properties must be the same in getNotifications.');
notifications[0].actions.foo = 'bar';
assert_throws(null, () => notifications[0].actions.push({ title: 'Foo' }));
assert_throws(new TypeError, () => notifications[0].actions.push({ title: 'Foo' }));
if (notifications[0].actions.length) {
notifications[0].actions[0].title = 'Changed';
......
This is a testharness.js-based test.
PASS PushMessageData initialization and accessor behaviour in a ServiceWorker.
PASS PushEvent can be initialized from ArrayBuffer, ArrayBufferView and USVStrings.
PASS PushMessageData is null by default.
PASS PushMessageData handling of ArrayBuffer content.
PASS PushMessageData handling of Blob content.
PASS PushMessageData handling of valid JSON content.
FAIL PushMessageData handling of invalid JSON content. Test bug: need to pass exception to assert_throws()
FAIL PushMessageData should not be constructable. Test bug: need to pass exception to assert_throws()
PASS PushEventInit data is not normalized
Harness: the test ran to completion.
......@@ -91,14 +91,14 @@ test(function() {
test(function() {
// Note that we do not care about the exception code - it's pass through.
assert_throws(null, () => createPushMessageData('\\o/').json());
assert_throws(new SyntaxError, () => createPushMessageData('\\o/').json());
}, 'PushMessageData handling of invalid JSON content.');
test(function() {
assert_throws(null, () => new PushMessageData());
assert_throws(null, () => new PushMessageData('Hello, world!'));
assert_throws(null, () => new PushMessageData(new ArrayBuffer(8)));
assert_throws(new TypeError, () => new PushMessageData());
assert_throws(new TypeError, () => new PushMessageData('Hello, world!'));
assert_throws(new TypeError, () => new PushMessageData(new ArrayBuffer(8)));
}, 'PushMessageData should not be constructable.');
......
This is a testharness.js-based test.
PASS bar
PASS foo
PASS named region
PASS single boolean struct
PASS types
PASS align
PASS utf8
FAIL typed pointer validation Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -290,7 +290,7 @@ test(() => {
var encoder = new mojo.internal.MessageV0Builder(42, 24).createEncoder(8);
invalidExamples.forEach(function(invalid) {
assert_throws(null, function() {
assert_throws(new Error, function() {
method.apply(encoder, baseArgs.concat(invalid));
});
});
......
This is a testharness.js-based test.
FAIL constructors Test bug: need to pass exception to assert_throws()
FAIL basic encoding Test bug: need to pass exception to assert_throws()
PASS unions in array encoding
PASS unions in map encoding
PASS nested unions encoding
PASS null union member validation
PASS null union validation
Harness: the test ran to completion.
......@@ -20,20 +20,20 @@ test(() => {
var u = new mojo.test.PodUnion({fUint64: 64});
assert_equals(u.fUint64, 64);
assert_equals(u.$tag, mojo.test.PodUnion.Tags.fUint64);
assert_throws(null, function() {var v = u.fUint32;});
assert_throws(new ReferenceError, function() {var v = u.fUint32;});
assert_throws(null, function() {
assert_throws(new TypeError, function() {
var u = new mojo.test.PodUnion({
fUint64: 64,
fUint32: 32,
});
});
assert_throws(null, function() {
assert_throws(new ReferenceError, function() {
var u = new mojo.test.PodUnion({ foo: 64 });
});
assert_throws(null, function() {
assert_throws(new TypeError, function() {
var u = new mojo.test.PodUnion([1,2,3,4]);
});
}, 'constructors');
......@@ -104,7 +104,7 @@ test(() => {
// Encoding a union with no member set is an error.
var s = new mojo.test.WrapperStruct({
objectUnion: new mojo.test.ObjectUnion()});
assert_throws(null, function() {
assert_throws(new TypeError, function() {
structEncodeDecode(s);
});
}, 'basic encoding');
......
This is a testharness.js-based test.
FAIL NFC IDL test Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -3,9 +3,9 @@
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
assert_throws(null, function() { new NFC(); },
assert_throws(new TypeError, function() { new NFC(); },
'the constructor should not be callable with "new"');
assert_throws(null, function() { NFC(); },
assert_throws(new TypeError, function() { NFC(); },
'the constructor should not be callable');
// Test that navigator.nfc.push exists
......
This is a testharness.js-based test.
FAIL Basic sanity-checking Test bug: need to pass exception to assert_throws()
FAIL Only whitelisted properties are accessible cross-origin Test bug: need to pass exception to assert_throws()
FAIL [[GetPrototypeOf]] should return null Test bug: need to pass exception to assert_throws()
FAIL [[SetPrototypeOf]] should throw Test bug: need to pass exception to assert_throws()
PASS [[IsExtensible]] should return true for cross-origin objects
FAIL [[PreventExtensions]] should throw for cross-origin objects Test bug: need to pass exception to assert_throws()
FAIL [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| Blocked a frame with origin "http://web-platform.test:8000" from accessing a cross-origin frame.
FAIL [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly assert_equals: property descriptor for postMessage should have writable: false expected false but got true
FAIL [[Delete]] Should throw on cross-origin objects Test bug: need to pass exception to assert_throws()
FAIL [[DefineOwnProperty]] Should throw for cross-origin objects Test bug: need to pass exception to assert_throws()
PASS [[Enumerate]] should return an empty iterator
FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.getOwnPropertyNames() gives the right answer for cross-origin Location lengths differ, expected 2 got 3
PASS A and B jointly observe the same identity for cross-origin Window and Location
PASS Cross-origin functions get local Function.prototype
FAIL Cross-origin Window accessors get local Function.prototype Cannot read property 'name' of undefined
FAIL Same-origin observers get different functions for cross-origin objects assert_true: same-origin Window functions get their own object expected true got false
FAIL Same-origin obsevers get different accessors for cross-origin Window assert_true: different Window accessors per-incumbent script settings object expected true got false
FAIL Same-origin observers get different accessors for cross-origin Location Blocked a frame with origin "http://web-platform.test:8000" from accessing a cross-origin frame.
PASS Cross-origin object identity preserved across document.domain
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Basic sanity-checking Test bug: need to pass exception to assert_throws()
FAIL Only whitelisted properties are accessible cross-origin Test bug: need to pass exception to assert_throws()
FAIL [[GetPrototypeOf]] should return null Test bug: need to pass exception to assert_throws()
FAIL [[SetPrototypeOf]] should throw Test bug: need to pass exception to assert_throws()
PASS [[IsExtensible]] should return true for cross-origin objects
FAIL [[PreventExtensions]] should throw for cross-origin objects Test bug: need to pass exception to assert_throws()
FAIL [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| Blocked a frame with origin "http://web-platform.test:8000" from accessing a cross-origin frame.
FAIL [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly assert_equals: property descriptor for postMessage should have writable: false expected false but got true
FAIL [[Delete]] Should throw on cross-origin objects Test bug: need to pass exception to assert_throws()
FAIL [[DefineOwnProperty]] Should throw for cross-origin objects Test bug: need to pass exception to assert_throws()
PASS [[Enumerate]] should return an empty iterator
FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.getOwnPropertyNames() gives the right answer for cross-origin Location lengths differ, expected 2 got 3
PASS A and B jointly observe the same identity for cross-origin Window and Location
PASS Cross-origin functions get local Function.prototype
FAIL Cross-origin Window accessors get local Function.prototype Cannot read property 'name' of undefined
FAIL Same-origin observers get different functions for cross-origin objects assert_true: same-origin Window functions get their own object expected true got false
FAIL Same-origin obsevers get different accessors for cross-origin Window assert_true: different Window accessors per-incumbent script settings object expected true got false
FAIL Same-origin observers get different accessors for cross-origin Location Blocked a frame with origin "http://web-platform.test:8000" from accessing a cross-origin frame.
PASS Cross-origin object identity preserved across document.domain
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Basic sanity-checking Test bug: need to pass exception to assert_throws()
FAIL Only whitelisted properties are accessible cross-origin Test bug: need to pass exception to assert_throws()
FAIL [[GetPrototypeOf]] should return null Test bug: need to pass exception to assert_throws()
FAIL [[SetPrototypeOf]] should throw Test bug: need to pass exception to assert_throws()
PASS [[IsExtensible]] should return true for cross-origin objects
FAIL [[PreventExtensions]] should throw for cross-origin objects Test bug: need to pass exception to assert_throws()
FAIL [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| Blocked a frame with origin "http://web-platform.test:8000" from accessing a cross-origin frame.
FAIL [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly assert_equals: property descriptor for postMessage should have writable: false expected false but got true
FAIL [[Delete]] Should throw on cross-origin objects Test bug: need to pass exception to assert_throws()
FAIL [[DefineOwnProperty]] Should throw for cross-origin objects Test bug: need to pass exception to assert_throws()
PASS [[Enumerate]] should return an empty iterator
FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.getOwnPropertyNames() gives the right answer for cross-origin Location lengths differ, expected 2 got 3
PASS A and B jointly observe the same identity for cross-origin Window and Location
PASS Cross-origin functions get local Function.prototype
FAIL Cross-origin Window accessors get local Function.prototype Cannot read property 'name' of undefined
FAIL Same-origin observers get different functions for cross-origin objects assert_true: same-origin Window functions get their own object expected true got false
FAIL Same-origin obsevers get different accessors for cross-origin Window assert_true: different Window accessors per-incumbent script settings object expected true got false
FAIL Same-origin observers get different accessors for cross-origin Location Blocked a frame with origin "http://web-platform.test:8000" from accessing a cross-origin frame.
PASS Cross-origin object identity preserved across document.domain
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS Registering observe call with empty transaction
FAIL Cannot observe during version change Test bug: need to pass exception to assert_throws()
PASS Abort transaction associated with observer
PASS Aborted transaction not recorded by observer
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS Registering observe call with empty transaction
FAIL Cannot observe during version change Test bug: need to pass exception to assert_throws()
PASS Abort transaction associated with observer
PASS Aborted transaction not recorded by observer
Harness: the test ran to completion.
......@@ -25,7 +25,7 @@ async_test(function(t) {
delete_then_open(t, dbname, function(t, db, request) {
request.result.createObjectStore('store');
assert_throws(null, function() {
assert_throws("TransactionInactiveError", function() {
obs.observe(db, request.transaction, { operationTypes: ['put'] });
});
t.done();
......@@ -79,4 +79,4 @@ async_test(function(t) {
});
}, 'Aborted transaction not recorded by observer');
done();
\ No newline at end of file
done();
This is a testharness.js-based test.
FAIL Tests calc() on presentation and non-presentation attr in svgLength Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
......@@ -42,7 +42,7 @@ function assert_calc_expression_on_width_attr(expression, expected) {
// Test calc with "valueAsString"
rect.setAttribute('width', '20px'); // reset to normal value
assert_throws(null, function() {rect.width.baseVal.valueAsString = expression});
assert_throws(new SyntaxError, function() {rect.width.baseVal.valueAsString = expression});
assert_equals(rect.width.baseVal.value, 20);
}
......@@ -67,7 +67,7 @@ function assert_calc_expression_on_markerWidth_attr(expression, expected) {
// Test calc with "valueAsString"
marker.setAttribute('markerWidth', '20px'); // reset to normal value
assert_throws(null, function() {marker.markerWidth.baseVal.valueAsString = expression});
assert_throws(new SyntaxError, function() {marker.markerWidth.baseVal.valueAsString = expression});
assert_equals(marker.markerWidth.baseVal.value, 20);
}
......
This is a testharness.js-based test.
FAIL Tests vw unit Test bug: need to pass exception to assert_throws()
FAIL Tests vh unit Test bug: need to pass exception to assert_throws()
FAIL Tests vmin unit Test bug: need to pass exception to assert_throws()
FAIL Tests vmax unit Test bug: need to pass exception to assert_throws()
Harness: the test ran to completion.
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<svg width="1" height="1" visibility="hidden">
<svg width="1" height="1" visibility="hidden">
</svg>
<script>
var svgElement = document.querySelector("svg");
......@@ -33,7 +33,7 @@ test(function() {
svgElement.setAttribute("width", "10vw");
assert_approx_equals(svgElement.width.baseVal.value, 10 * viewportWidthPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.valueInSpecifiedUnits, 10);
assert_throws(null, function() {svgElement.width.baseVal.valueAsString = '2vw'});
assert_throws(new SyntaxError, function() {svgElement.width.baseVal.valueAsString = '2vw'});
svgElement.width.baseVal.valueInSpecifiedUnits = 2;
assert_approx_equals(svgElement.width.baseVal.value, 2 * viewportWidthPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.unitType, SVGLength.SVG_LENGTHTYPE_UNKNOWN);
......@@ -43,7 +43,7 @@ test(function() {
svgElement.setAttribute("width", "10vh");
assert_approx_equals(svgElement.width.baseVal.value, 10 * viewportHeightPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.valueInSpecifiedUnits, 10);
assert_throws(null, function() {svgElement.width.baseVal.valueAsString = '2vh'});
assert_throws(new SyntaxError, function() {svgElement.width.baseVal.valueAsString = '2vh'});
svgElement.width.baseVal.valueInSpecifiedUnits = 2;
assert_approx_equals(svgElement.width.baseVal.value, 2 * viewportHeightPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.unitType, SVGLength.SVG_LENGTHTYPE_UNKNOWN);
......@@ -53,7 +53,7 @@ test(function() {
svgElement.setAttribute("width", "10vmin");
assert_approx_equals(svgElement.width.baseVal.value, 10 * viewportMinPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.valueInSpecifiedUnits, 10);
assert_throws(null, function() {svgElement.width.baseVal.valueAsString = '2vmin'});
assert_throws(new SyntaxError, function() {svgElement.width.baseVal.valueAsString = '2vmin'});
svgElement.width.baseVal.valueInSpecifiedUnits = 2;
assert_approx_equals(svgElement.width.baseVal.value, 2 * viewportMinPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.unitType, SVGLength.SVG_LENGTHTYPE_UNKNOWN);
......@@ -63,7 +63,7 @@ test(function() {
svgElement.setAttribute("width", "10vmax");
assert_approx_equals(svgElement.width.baseVal.value, 10 * viewportMaxPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.valueInSpecifiedUnits, 10);
assert_throws(null, function() {svgElement.width.baseVal.valueAsString = '2vmax'});
assert_throws(new SyntaxError, function() {svgElement.width.baseVal.valueAsString = '2vmax'});
svgElement.width.baseVal.valueInSpecifiedUnits = 2;
assert_approx_equals(svgElement.width.baseVal.value, 2 * viewportMaxPercent(), EPSILON);
assert_equals(svgElement.width.baseVal.unitType, SVGLength.SVG_LENGTHTYPE_UNKNOWN);
......
This is a testharness.js-based test.
PASS Test valid unit types are accepted in valueAsString
FAIL Test invalid unit types are not accepted in valueAsString Test bug: need to pass exception to assert_throws()
PASS Test that unit constants that are supposed to be exposed are available
PASS Test that unit constants that are not supposed to be exposed are not available
PASS Test result from valueInSpecifiedUnits
PASS Test converting unit types for non-relative units
PASS Test newValueSpecifiedUnits for each unit
Harness: the test ran to completion.
<!doctype html>
<!doctype html>
<title>SVGlength tests</title>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
......@@ -11,10 +11,10 @@ var svg = document.querySelector("svg");
var EPSILON = Math.pow(2, -8);
var lengths = [10, 0, 360, 500, 90, 180, 45, 25.9];
var validUnits = {
"" : 1,
"%": 2,
"em": 3,
var validUnits = {
"" : 1,
"%": 2,
"em": 3,
"ex": 4,
"px": 5,
"cm": 6,
......@@ -102,7 +102,7 @@ test(function() {
"ch": 2
};
for (var unit in invalidUnits) {
assert_throws(null, function() { createLength(10 + unit) });
assert_throws(new SyntaxError, function() { createLength(10 + unit) });
}
}, "Test invalid unit types are not accepted in valueAsString");
......
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