OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <title>Test that Node.appendChild throws TypeError when a wrong type of argument
is passed.</title> |
4 <script src="../../../resources/testharness.js"></script> | 5 <script src="../../../resources/testharness.js"></script> |
5 <script src="../../../resources/testharnessreport.js"></script> | 6 <script src="../../../resources/testharnessreport.js"></script> |
6 </head> | 7 </head> |
7 <body> | 8 <body> |
8 This test case verifies if relevant TypeError is thrown when invalid Node argume
nt is given. | |
9 <script> | 9 <script> |
10 test(function() { | 10 test(function() { |
11 assert_throws(new TypeError(), function() { document.body.appendChild() }) | 11 assert_throws(new TypeError(), function() { document.body.appendChild() }) |
12 assert_throws(new TypeError(), function() { document.body.appendChild(null)
}) | 12 assert_throws(new TypeError(), function() { document.body.appendChild(null)
}) |
13 assert_throws(new TypeError(), function() { document.body.appendChild({'a':'
b'}) }) | 13 assert_throws(new TypeError(), function() { document.body.appendChild({'a':'
b'}) }) |
14 }, "Node.appendChild should throw TypeError when a wrong type of argument is pas
sed.") | 14 }) |
15 </script> | 15 </script> |
16 </body> | 16 </body> |
17 </html> | 17 </html> |
OLD | NEW |