OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script> | 4 <script> |
5 | 5 |
6 function test() | 6 function test() |
7 { | 7 { |
8 InspectorTest.registerModule("documentation", true); | 8 InspectorTest.registerModule("documentation", true); |
9 | 9 |
10 InspectorTest.runTestSuite([ | 10 InspectorTest.runTestSuite([ |
11 function testWikiParser(next) | 11 function testWikiParser(next) |
12 { | 12 { |
13 var testCases = [ | 13 var testCases = [ |
14 "{{A|Code= var nod{{=}}document.createElement(\"li\");\ndocument .getElementById(\"oUL1\").insertBefore(nod, document.getElementById(\"oLIYellow\ "));\nnod.textContet{{=}}\"Orange\"}}", | |
loislo
2014/09/09 08:06:57
please reduce the size of the line.
iliia
2014/09/09 08:19:28
There is the same test in testExamples, so I will
| |
15 "{{A|Code={{=}} }}", | |
16 "{{A|B=C}}", | |
14 "{{A|B={{C|D=blablabla}}}}", | 17 "{{A|B={{C|D=blablabla}}}}", |
15 "{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n |Description=[[css/color|CSS color value]]}}\n}}", | 18 "{{A|B={{C|D=bla}}|x=y}}", |
19 "{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n |Description= [[css/color|CSS color value]]}}\n}}", | |
16 "{{A}}", | 20 "{{A}}", |
17 "{{A|B=bla<a=c>bla}}", | 21 "{{A|B= [[google.com{{!}}Google]]}}", |
18 "{{A}}", | 22 "{{AbC|xyz \n\t \r}}", |
19 "{{AbC|xyz \n \t \r}}"]; | 23 "{{External_Attribution|MSDN_link=[http://msdn.microsoft.com/en- us/library/ie/ms536365(v=vs.85).aspx cloneNode Method]|HTML5Rocks_link=}}", |
24 "{{JS_Syntax|Formats={{JS Syntax Format|Format='''JSON.stringify (''' value [ , replacer] [ , space] ''')'''}}\n}}"]; | |
20 for (var i = 0; i < testCases.length; i++) { | 25 for (var i = 0; i < testCases.length; i++) { |
21 var wikiParser = new WebInspector.WikiParser(testCases[i]); | 26 var wikiParser = new WebInspector.WikiParser(testCases[i]); |
22 InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r") + "\" is parsed"); | 27 InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r") + "\" is parsed"); |
23 InspectorTest.addObject(wikiParser.document()); | 28 InspectorTest.addObject(wikiParser.document()); |
24 } | 29 } |
25 next(); | 30 next(); |
26 }, | 31 }, |
27 | 32 |
28 function testJS(next) | 33 function testJS(next) |
29 { | 34 { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 { | 122 { |
118 var jsMethodTest = "{{API_Object_Method\n|Parameters={{Method Parame ter\n|Name=newNode\n|Data type=DOM Node\n|Description=The new node to be inserte d.\n|Optional=No\n}}{{Method Parameter\n|Name=refChild\n|Data type=DOM Node\n|De scription=Supplies the placement of the new node. If this parameter is specified , the new element will be inserted immediately before this existing child node. If not, it will be added after the last child node.\n|Optional=Yes\n}}\n|Method_ applies_to=dom/Node\n|Example_object_name=node\n|Return_value_name=insertedNode\ n|Javascript_data_type=DOM Node\n|Return_value_description=The inserted node.\n} }\n"; | 123 var jsMethodTest = "{{API_Object_Method\n|Parameters={{Method Parame ter\n|Name=newNode\n|Data type=DOM Node\n|Description=The new node to be inserte d.\n|Optional=No\n}}{{Method Parameter\n|Name=refChild\n|Data type=DOM Node\n|De scription=Supplies the placement of the new node. If this parameter is specified , the new element will be inserted immediately before this existing child node. If not, it will be added after the last child node.\n|Optional=Yes\n}}\n|Method_ applies_to=dom/Node\n|Example_object_name=node\n|Return_value_name=insertedNode\ n|Javascript_data_type=DOM Node\n|Return_value_description=The inserted node.\n} }\n"; |
119 var article = WebInspector.JSArticle.parse(jsMethodTest); | 124 var article = WebInspector.JSArticle.parse(jsMethodTest); |
120 InspectorTest.addObject(article); | 125 InspectorTest.addObject(article); |
121 next(); | 126 next(); |
122 }, | 127 }, |
123 | 128 |
124 function testLinkWithoutSpace(next) | 129 function testLinkWithoutSpace(next) |
125 { | 130 { |
126 var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRO NG_LINK]]}}"; | 131 var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRO NG_LINK]]}}"; |
127 var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest); | 132 try { |
128 InspectorTest.addObject(article); | 133 var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest) ; |
134 InspectorTest.addObject(article); | |
135 } catch (error) { | |
136 InspectorTest.addResult("Expected error: " + error); | |
137 } | |
129 next(); | 138 next(); |
130 } | 139 } |
131 ]); | 140 ]); |
132 } | 141 } |
133 | |
134 </script> | 142 </script> |
135 </head> | 143 </head> |
136 | 144 |
137 <body onload="runTest()"> | 145 <body onload="runTest()"> |
138 | 146 |
139 </body> | 147 </body> |
140 </html> | 148 </html> |
OLD | NEW |