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={{=}} }}", |
| 15 "{{ABC|Array={{A|B=c}}{{X|y=Z}}|text=blabla}}", |
| 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 "{{Table|there is a table {{{!}}\n}}", |
| 24 "{{External_Attribution|MSDN_link=[http://msdn.microsoft.com/en-
us/library/ie/ms536365(v=vs.85).aspx cloneNode Method]|HTML5Rocks_link=}}", |
| 25 "{{JS_Syntax|Formats={{JS Syntax Format|Format='''JSON.stringify
(''' value [ , replacer] [ , space] ''')'''}}\n}}"]; |
20 for (var i = 0; i < testCases.length; i++) { | 26 for (var i = 0; i < testCases.length; i++) { |
21 var wikiParser = new WebInspector.WikiParser(testCases[i]); | 27 var wikiParser = new WebInspector.WikiParser(testCases[i]); |
22 InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r")
+ "\" is parsed"); | 28 InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r")
+ "\" is parsed"); |
23 InspectorTest.addObject(wikiParser.document()); | 29 InspectorTest.addObject(wikiParser.document()); |
24 } | 30 } |
25 next(); | 31 next(); |
26 }, | 32 }, |
27 | 33 |
28 function testJS(next) | 34 function testJS(next) |
29 { | 35 { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 { | 123 { |
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"; | 124 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); | 125 var article = WebInspector.JSArticle.parse(jsMethodTest); |
120 InspectorTest.addObject(article); | 126 InspectorTest.addObject(article); |
121 next(); | 127 next(); |
122 }, | 128 }, |
123 | 129 |
124 function testLinkWithoutSpace(next) | 130 function testLinkWithoutSpace(next) |
125 { | 131 { |
126 var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRO
NG_LINK]]}}"; | 132 var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRO
NG_LINK]]}}"; |
127 var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest); | 133 try { |
128 InspectorTest.addObject(article); | 134 var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest)
; |
| 135 InspectorTest.addObject(article); |
| 136 } catch (error) { |
| 137 InspectorTest.addResult("Expected error: " + error); |
| 138 } |
129 next(); | 139 next(); |
130 } | 140 } |
131 ]); | 141 ]); |
132 } | 142 } |
133 | |
134 </script> | 143 </script> |
135 </head> | 144 </head> |
136 | 145 |
137 <body onload="runTest()"> | 146 <body onload="runTest()"> |
138 | 147 |
139 </body> | 148 </body> |
140 </html> | 149 </html> |
OLD | NEW |