Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / processing-instruction-appendChild-exceptions.xhtml
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <body>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 <![CDATA[
6 description("Test that appropriate exceptions are thrown when adding children to a ProcessingInstruction.");
7 var pi = document.createProcessingInstruction('target', 'data');
8 shouldThrow("pi.appendChild(null)", '"TypeError: Failed to execute \'appendChild\' on \'Node\': parameter 1 is not of type \'Node\'."');
9 var div = document.createElement('div');
10 shouldThrow("pi.appendChild(div)", '"HierarchyRequestError: Failed to execute \'appendChild\' on \'Node\': This node type does not support this method."');
11 var textNode = document.createTextNode('sometext');
12 shouldThrow("pi.appendChild(textNode)", '"HierarchyRequestError: Failed to execute \'appendChild\' on \'Node\': This node type does not support this method."');
13 ]]>
14 </script>
15 </body>
16 </html>