mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-21 20:24:42 +00:00
fix test for new messages
This commit is contained in:
@@ -24,11 +24,10 @@
|
|||||||
|
|
||||||
<script id=byId name="test1">
|
<script id=byId name="test1">
|
||||||
testing.expectEqual(1, document.querySelector.length);
|
testing.expectEqual(1, document.querySelector.length);
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => document.querySelector(''));
|
testing.expectError("SyntaxError", () => document.querySelector(''));
|
||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(12, err.code);
|
testing.expectEqual(12, err.code);
|
||||||
testing.expectEqual("SyntaxError", err.name);
|
testing.expectEqual("SyntaxError", err.name);
|
||||||
testing.expectEqual("Syntax Error", err.message);
|
|
||||||
}, () => document.querySelector(''));
|
}, () => document.querySelector(''));
|
||||||
|
|
||||||
testing.expectEqual('test1', document.querySelector('#byId').getAttribute('name'));
|
testing.expectEqual('test1', document.querySelector('#byId').getAttribute('name'));
|
||||||
|
|||||||
@@ -34,11 +34,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script id=script1 name="test1">
|
<script id=script1 name="test1">
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => document.querySelectorAll(''));
|
testing.expectError("SyntaxError", () => document.querySelectorAll(''));
|
||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(12, err.code);
|
testing.expectEqual(12, err.code);
|
||||||
testing.expectEqual("SyntaxError", err.name);
|
testing.expectEqual("SyntaxError", err.name);
|
||||||
testing.expectEqual("Syntax Error", err.message);
|
|
||||||
}, () => document.querySelectorAll(''));
|
}, () => document.querySelectorAll(''));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
|
|
||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(3, err.code);
|
testing.expectEqual(3, err.code);
|
||||||
testing.expectEqual('Hierarchy Error', err.message);
|
testing.expectEqual('HierarchyRequestError', err.name);
|
||||||
testing.expectEqual(true, err instanceof DOMException);
|
testing.expectEqual(true, err instanceof DOMException);
|
||||||
testing.expectEqual(true, err instanceof Error);
|
testing.expectEqual(true, err instanceof Error);
|
||||||
}, () => link.appendChild(content));
|
}, () => link.appendChild(content));
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(8, err.code);
|
testing.expectEqual(8, err.code);
|
||||||
testing.expectEqual("NotFoundError", err.name);
|
testing.expectEqual("NotFoundError", err.name);
|
||||||
testing.expectEqual("Not Found", err.message);
|
|
||||||
}, () => el1.removeAttributeNode(script_id_node));
|
}, () => el1.removeAttributeNode(script_id_node));
|
||||||
|
|
||||||
testing.expectEqual(an1, el1.removeAttributeNode(an1));
|
testing.expectEqual(an1, el1.removeAttributeNode(an1));
|
||||||
|
|||||||
@@ -66,11 +66,10 @@
|
|||||||
{
|
{
|
||||||
const container = $('#test-container');
|
const container = $('#test-container');
|
||||||
|
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => container.matches(''));
|
testing.expectError("SyntaxError", () => container.matches(''));
|
||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(12, err.code);
|
testing.expectEqual(12, err.code);
|
||||||
testing.expectEqual("SyntaxError", err.name);
|
testing.expectEqual("SyntaxError", err.name);
|
||||||
testing.expectEqual("Syntax Error", err.message);
|
|
||||||
}, () => container.matches(''));
|
}, () => container.matches(''));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,11 +12,10 @@
|
|||||||
const p1 = $('#p1');
|
const p1 = $('#p1');
|
||||||
testing.expectEqual(null, p1.querySelector('#p1'));
|
testing.expectEqual(null, p1.querySelector('#p1'));
|
||||||
|
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => p1.querySelector(''));
|
testing.expectError("SyntaxError", () => p1.querySelector(''));
|
||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(12, err.code);
|
testing.expectEqual(12, err.code);
|
||||||
testing.expectEqual("SyntaxError", err.name);
|
testing.expectEqual("SyntaxError", err.name);
|
||||||
testing.expectEqual("Syntax Error", err.message);
|
|
||||||
}, () => p1.querySelector(''));
|
}, () => p1.querySelector(''));
|
||||||
|
|
||||||
testing.expectEqual($('#c2'), p1.querySelector('#c2'));
|
testing.expectEqual($('#c2'), p1.querySelector('#c2'));
|
||||||
|
|||||||
@@ -24,11 +24,10 @@
|
|||||||
<script id=errors>
|
<script id=errors>
|
||||||
{
|
{
|
||||||
const root = $('#root');
|
const root = $('#root');
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => root.querySelectorAll(''));
|
testing.expectError("SyntaxError", () => root.querySelectorAll(''));
|
||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(12, err.code);
|
testing.expectEqual(12, err.code);
|
||||||
testing.expectEqual("SyntaxError", err.name);
|
testing.expectEqual("SyntaxError", err.name);
|
||||||
testing.expectEqual("Syntax Error", err.message);
|
|
||||||
}, () => root.querySelectorAll(''));
|
}, () => root.querySelectorAll(''));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,8 +43,8 @@
|
|||||||
const container = $('#container');
|
const container = $('#container');
|
||||||
|
|
||||||
// Empty selectors
|
// Empty selectors
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => container.querySelector(''));
|
testing.expectError("SyntaxError", () => container.querySelector(''));
|
||||||
testing.expectError("SyntaxError: Syntax Error", () => document.querySelectorAll(''));
|
testing.expectError("SyntaxError", () => document.querySelectorAll(''));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(8, err.code);
|
testing.expectEqual(8, err.code);
|
||||||
testing.expectEqual("NotFoundError", err.name);
|
testing.expectEqual("NotFoundError", err.name);
|
||||||
testing.expectEqual("Not Found", err.message);
|
|
||||||
}, () => d1.insertBefore(document.createElement('div'), d2));
|
}, () => d1.insertBefore(document.createElement('div'), d2));
|
||||||
|
|
||||||
let c1 = document.createElement('div');
|
let c1 = document.createElement('div');
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(8, err.code);
|
testing.expectEqual(8, err.code);
|
||||||
testing.expectEqual("NotFoundError", err.name);
|
testing.expectEqual("NotFoundError", err.name);
|
||||||
testing.expectEqual("Not Found", err.message);
|
|
||||||
}, () => $('#d1').removeChild($('#p1')));
|
}, () => $('#d1').removeChild($('#p1')));
|
||||||
|
|
||||||
const p1 = $('#p1');
|
const p1 = $('#p1');
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
testing.withError((err) => {
|
testing.withError((err) => {
|
||||||
testing.expectEqual(3, err.code);
|
testing.expectEqual(3, err.code);
|
||||||
testing.expectEqual("HierarchyRequestError", err.name);
|
testing.expectEqual("HierarchyRequestError", err.name);
|
||||||
testing.expectEqual("Hierarchy Error", err.message);
|
|
||||||
}, () => d1.replaceChild(c4, c3));
|
}, () => d1.replaceChild(c4, c3));
|
||||||
|
|
||||||
testing.expectEqual(c2, d1.replaceChild(c4, c2));
|
testing.expectEqual(c2, d1.replaceChild(c4, c2));
|
||||||
|
|||||||
@@ -451,12 +451,12 @@
|
|||||||
const p1 = $('#p1');
|
const p1 = $('#p1');
|
||||||
|
|
||||||
// Test setStart with offset beyond node length
|
// Test setStart with offset beyond node length
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.setStart(p1, 999);
|
range.setStart(p1, 999);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Test with negative offset (wraps to large u32)
|
// Test with negative offset (wraps to large u32)
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.setStart(p1.firstChild, -1);
|
range.setStart(p1.firstChild, -1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -468,12 +468,12 @@
|
|||||||
const p1 = $('#p1');
|
const p1 = $('#p1');
|
||||||
|
|
||||||
// Test setEnd with offset beyond node length
|
// Test setEnd with offset beyond node length
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.setEnd(p1, 999);
|
range.setEnd(p1, 999);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Test with text node
|
// Test with text node
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.setEnd(p1.firstChild, 9999);
|
range.setEnd(p1.firstChild, 9999);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -525,11 +525,11 @@
|
|||||||
range.setEnd(p1, 1);
|
range.setEnd(p1, 1);
|
||||||
|
|
||||||
// Test comparePoint with invalid offset
|
// Test comparePoint with invalid offset
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.comparePoint(p1, 20);
|
range.comparePoint(p1, 20);
|
||||||
});
|
});
|
||||||
|
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.comparePoint(p1.firstChild, -1);
|
range.comparePoint(p1.firstChild, -1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -650,11 +650,11 @@
|
|||||||
range.setEnd(p1, 1);
|
range.setEnd(p1, 1);
|
||||||
|
|
||||||
// Invalid offset should throw IndexSizeError
|
// Invalid offset should throw IndexSizeError
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.isPointInRange(p1, 999);
|
range.isPointInRange(p1, 999);
|
||||||
});
|
});
|
||||||
|
|
||||||
testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => {
|
testing.expectError('IndexSizeError:', () => {
|
||||||
range.isPointInRange(p1.firstChild, 9999);
|
range.isPointInRange(p1.firstChild, 9999);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -854,11 +854,11 @@
|
|||||||
range2.setStart(p, 0);
|
range2.setStart(p, 0);
|
||||||
|
|
||||||
// Invalid how parameter should throw NotSupportedError
|
// Invalid how parameter should throw NotSupportedError
|
||||||
testing.expectError('NotSupportedError: Not Supported', () => {
|
testing.expectError('NotSupportedError:', () => {
|
||||||
range1.compareBoundaryPoints(4, range2);
|
range1.compareBoundaryPoints(4, range2);
|
||||||
});
|
});
|
||||||
|
|
||||||
testing.expectError('NotSupportedError: Not Supported', () => {
|
testing.expectError('NotSupportedError:', () => {
|
||||||
range1.compareBoundaryPoints(99, range2);
|
range1.compareBoundaryPoints(99, range2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -883,7 +883,7 @@
|
|||||||
range2.setEnd(foreignP, 1);
|
range2.setEnd(foreignP, 1);
|
||||||
|
|
||||||
// Comparing ranges in different documents should throw WrongDocumentError
|
// Comparing ranges in different documents should throw WrongDocumentError
|
||||||
testing.expectError('WrongDocumentError: wrong_document_error', () => {
|
testing.expectError('WrongDocumentError:', () => {
|
||||||
range1.compareBoundaryPoints(Range.START_TO_START, range2);
|
range1.compareBoundaryPoints(Range.START_TO_START, range2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
testing.expectEqual('ceil', atob('Y2VpbA')); // 6 chars, len%4==2, needs '=='
|
testing.expectEqual('ceil', atob('Y2VpbA')); // 6 chars, len%4==2, needs '=='
|
||||||
|
|
||||||
// length % 4 == 1 must still throw
|
// length % 4 == 1 must still throw
|
||||||
testing.expectError('InvalidCharacterError: Invalid Character', () => {
|
testing.expectError('InvalidCharacterError', () => {
|
||||||
atob('Y');
|
atob('Y');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user