Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Side by Side Diff: LayoutTests/dom/xhtml/level2/core/createAttributeNS06.js

Issue 740223003: Revive tests for Document.createAttributeNS() and Element.setAttributeNodeNS() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: deprecation messages Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 Copyright © 2001-2004 World Wide Web Consortium, 3 Copyright © 2001-2004 World Wide Web Consortium,
4 (Massachusetts Institute of Technology, European Research Consortium 4 (Massachusetts Institute of Technology, European Research Consortium
5 for Informatics and Mathematics, Keio University). All 5 for Informatics and Mathematics, Keio University). All
6 Rights Reserved. This work is distributed under the W3C® Software License [1] i n the 6 Rights Reserved. This work is distributed under the W3C® Software License [1] i n the
7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even 7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 9
10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
11 */ 11 */
12 12
13 13
14 14
15 /** 15 /**
16 * Gets URI that identifies the test. 16 * Gets URI that identifies the test.
17 * @return uri identifier of test 17 * @return uri identifier of test
18 */ 18 */
19 function getTargetURI() { 19 function getTargetURI() {
20 return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS0 6"; 20 return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeN S06";
21 } 21 }
22 22
23 var docsLoaded = -1000000; 23 var docsLoaded = -1000000;
24 var builder = null; 24 var builder = null;
25 25
26 // 26 //
27 // This function is called by the testing framework before 27 // This function is called by the testing framework before
28 // running the test suite. 28 // running the test suite.
29 // 29 //
30 // If there are no configuration exceptions, asynchronous 30 // If there are no configuration exceptions, asynchronous
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // body of the test to be executed. 68 // body of the test to be executed.
69 function loadComplete() { 69 function loadComplete() {
70 if (++docsLoaded == 1) { 70 if (++docsLoaded == 1) {
71 setUpPageStatus = 'complete'; 71 setUpPageStatus = 'complete';
72 } 72 }
73 } 73 }
74 74
75 75
76 /** 76 /**
77 * 77 *
78 Document.createElementNS with an empty qualified name should cause an INVALID_CH ARACTER_ERR. 78 Document.createAttributeNS with an empty qualified name should cause an INVALID_ CHARACTER_ERR.
79 79
80 * @author Curt Arnold 80 * @author Curt Arnold
81 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS 81 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS
82 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/ra ises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CH ARACTER_ERR']) 82 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/ raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_ CHARACTER_ERR'])
83 * @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 83 * @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525
84 */ 84 */
85 function createElementNS06() { 85 function createAttributeNS06() {
86 var success; 86 var success;
87 if(checkInitialization(builder, "createElementNS06") != null) return; 87 if(checkInitialization(builder, "createAttributeNS06") != null) return;
88 var namespaceURI = "http://www.example.com/"; 88 var namespaceURI = "http://www.example.com/";
89 var qualifiedName; 89 var qualifiedName;
90 var doc; 90 var doc;
91 var done; 91 var newAttr;
92 var newElement;
93 var charact;
94 92
95 var docRef = null; 93 var docRef = null;
96 if (typeof(this.doc) != 'undefined') { 94 if (typeof(this.doc) != 'undefined') {
97 docRef = this.doc; 95 docRef = this.doc;
98 } 96 }
99 doc = load(docRef, "doc", "hc_staff"); 97 doc = load(docRef, "doc", "hc_staff");
100 98
101 { 99 {
102 success = false; 100 success = false;
103 try { 101 try {
104 newElement = doc.createElementNS(namespaceURI,""); 102 newAttr = doc.createAttributeNS(namespaceURI,"");
105 } 103 }
106 catch(ex) { 104 catch(ex) {
107 success = (typeof(ex.code) != 'undefined' && ex.code == 5); 105 success = (typeof(ex.code) != 'undefined' && ex.code == 5);
108 } 106 }
109 assertTrue("throw_INVALID_CHARACTER_ERR",success); 107 assertTrue("throw_INVALID_CHARACTER_ERR",success);
110 } 108 }
111 109
112 } 110 }
113 111
114 112
115 113
116 114
117 function runTest() { 115 function runTest() {
118 createElementNS06(); 116 createAttributeNS06();
119 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698