OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 description("createDocument tests modelled after mozilla's testing"); | 8 description("createDocument tests modelled after mozilla's testing"); |
9 | 9 |
10 function ExpectedNotEnoughArgumentsMessage(num) { | 10 function ExpectedNotEnoughArgumentsMessage(num) { |
11 return "\"TypeError: Failed to execute 'createDocumentType' on 'DOMImplement
ation': 3 arguments required, but only " + num + " present.\""; | 11 return "\"TypeError: Failed to execute 'createDocumentType' on 'DOMImplement
ation': 3 arguments required, but only " + num + " present.\""; |
12 } | 12 } |
13 | 13 |
14 shouldThrow("document.implementation.createDocumentType('foo')", ExpectedNotEnou
ghArgumentsMessage(1)); | 14 shouldThrow("document.implementation.createDocumentType('foo')", ExpectedNotEnou
ghArgumentsMessage(1)); |
15 shouldThrow("document.implementation.createDocumentType('foo', null)", ExpectedN
otEnoughArgumentsMessage(2)); | 15 shouldThrow("document.implementation.createDocumentType('foo', null)", ExpectedN
otEnoughArgumentsMessage(2)); |
16 shouldThrow("document.implementation.createDocumentType(undefined, undefined)",
ExpectedNotEnoughArgumentsMessage(2)); | 16 shouldThrow("document.implementation.createDocumentType(undefined, undefined)",
ExpectedNotEnoughArgumentsMessage(2)); |
17 shouldThrow("document.implementation.createDocumentType(null, undefined)", Expec
tedNotEnoughArgumentsMessage(2)); | 17 shouldThrow("document.implementation.createDocumentType(null, undefined)", Expec
tedNotEnoughArgumentsMessage(2)); |
18 shouldThrow("document.implementation.createDocumentType(undefined, null)", Expec
tedNotEnoughArgumentsMessage(2)); | 18 shouldThrow("document.implementation.createDocumentType(undefined, null)", Expec
tedNotEnoughArgumentsMessage(2)); |
19 shouldNotThrow("document.implementation.createDocumentType(undefined, undefined,
null)"); | 19 shouldNotThrow("document.implementation.createDocumentType(undefined, undefined,
null)"); |
20 shouldThrow("document.implementation.createDocumentType(null, null)", ExpectedNo
tEnoughArgumentsMessage(2)); | 20 shouldThrow("document.implementation.createDocumentType(null, null)", ExpectedNo
tEnoughArgumentsMessage(2)); |
21 shouldThrow("document.implementation.createDocumentType(null, '')", ExpectedNotE
noughArgumentsMessage(2)); | 21 shouldThrow("document.implementation.createDocumentType(null, '')", ExpectedNotE
noughArgumentsMessage(2)); |
22 shouldThrow("document.implementation.createDocumentType('', null)", ExpectedNotE
noughArgumentsMessage(2)); | 22 shouldThrow("document.implementation.createDocumentType('', null)", ExpectedNotE
noughArgumentsMessage(2)); |
23 shouldThrow("document.implementation.createDocumentType('', '')", ExpectedNotEno
ughArgumentsMessage(2)); | 23 shouldThrow("document.implementation.createDocumentType('', '')", ExpectedNotEno
ughArgumentsMessage(2)); |
24 shouldThrow("document.implementation.createDocumentType('a:', null, null)", '"Na
mespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\':
The qualified name provided (\'a:\') has an empty local name."'); | 24 shouldThrow("document.implementation.createDocumentType('a:', null, null)", '"In
validCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementa
tion\': The qualified name provided (\'a:\') has an empty local name."'); |
25 shouldThrow("document.implementation.createDocumentType(':foo', null, null)", '"
NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\
': The qualified name provided (\':foo\') has an empty namespace prefix."'); | 25 shouldThrow("document.implementation.createDocumentType(':foo', null, null)", '"
InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplemen
tation\': The qualified name provided (\':foo\') has an empty namespace prefix."
'); |
26 shouldThrow("document.implementation.createDocumentType(':', null, null)", '"Nam
espaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\':
The qualified name provided (\':\') has an empty namespace prefix."'); | 26 shouldThrow("document.implementation.createDocumentType(':', null, null)", '"Inv
alidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementat
ion\': The qualified name provided (\':\') has an empty namespace prefix."'); |
27 shouldNotThrow("document.implementation.createDocumentType('foo', null, null)"); | 27 shouldNotThrow("document.implementation.createDocumentType('foo', null, null)"); |
28 shouldNotThrow("document.implementation.createDocumentType('foo:bar', null, null
)"); | 28 shouldNotThrow("document.implementation.createDocumentType('foo:bar', null, null
)"); |
29 shouldThrow("document.implementation.createDocumentType('foo::bar', null, null)"
, '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementat
ion\': The qualified name provided (\'foo::bar\') contains multiple colons."'); | 29 shouldThrow("document.implementation.createDocumentType('foo::bar', null, null)"
, '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImpl
ementation\': The qualified name provided (\'foo::bar\') contains multiple colon
s."'); |
30 shouldThrow("document.implementation.createDocumentType('\t:bar', null, null)",
'"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplem
entation\': The qualified name provided (\'\t:bar\') contains the invalid name-s
tart character \'\t\'."'); | 30 shouldThrow("document.implementation.createDocumentType('\t:bar', null, null)",
'"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplem
entation\': The qualified name provided (\'\t:bar\') contains the invalid name-s
tart character \'\t\'."'); |
31 shouldThrow("document.implementation.createDocumentType('foo:\t', null, null)",
'"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplem
entation\': The qualified name provided (\'foo:\t\') contains the invalid name-s
tart character \'\t\'."'); | 31 shouldThrow("document.implementation.createDocumentType('foo:\t', null, null)",
'"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplem
entation\': The qualified name provided (\'foo:\t\') contains the invalid name-s
tart character \'\t\'."'); |
32 shouldThrow("document.implementation.createDocumentType('foo :bar', null, null)"
, '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImpl
ementation\': The qualified name provided (\'foo :bar\') contains the invalid ch
aracter \' \'."'); | 32 shouldThrow("document.implementation.createDocumentType('foo :bar', null, null)"
, '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImpl
ementation\': The qualified name provided (\'foo :bar\') contains the invalid ch
aracter \' \'."'); |
33 shouldThrow("document.implementation.createDocumentType('foo: bar', null, null)"
, '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImpl
ementation\': The qualified name provided (\'foo: bar\') contains the invalid na
me-start character \' \'."'); | 33 shouldThrow("document.implementation.createDocumentType('foo: bar', null, null)"
, '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImpl
ementation\': The qualified name provided (\'foo: bar\') contains the invalid na
me-start character \' \'."'); |
34 shouldThrow("document.implementation.createDocumentType('a:b:c', null, null)", '
"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation
\': The qualified name provided (\'a:b:c\') contains multiple colons."'); | 34 shouldThrow("document.implementation.createDocumentType('a:b:c', null, null)", '
"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImpleme
ntation\': The qualified name provided (\'a:b:c\') contains multiple colons."'); |
35 | 35 |
36 </script> | 36 </script> |
37 </body> | 37 </body> |
38 </html> | 38 </html> |
OLD | NEW |