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

Side by Side Diff: LayoutTests/inspector/documentation/document-parser.html

Issue 539353004: DevTools: [Documentation] Update parser for WikiText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: comments addressed Created 6 years, 3 months 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
OLDNEW
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 "{{A|B=C}}",
14 "{{A|B={{C|D=blablabla}}}}", 16 "{{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}}", 17 "{{A|B={{C|D=bla}}|x=y}}",
18 "{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n |Description= [[css/color|CSS color value]]}}\n}}",
16 "{{A}}", 19 "{{A}}",
17 "{{A|B=bla<a=c>bla}}", 20 "{{A|B= [[google.com{{!}}Google]]}}",
18 "{{A}}", 21 "{{AbC|xyz \n\t \r}}",
19 "{{AbC|xyz \n \t \r}}"]; 22 "{{External_Attribution|MSDN_link=[http://msdn.microsoft.com/en- us/library/ie/ms536365(v=vs.85).aspx cloneNode Method]|HTML5Rocks_link=}}",
23 "{{JS_Syntax|Formats={{JS Syntax Format|Format='''JSON.stringify (''' value [ , replacer] [ , space] ''')'''}}\n}}"];
20 for (var i = 0; i < testCases.length; i++) { 24 for (var i = 0; i < testCases.length; i++) {
21 var wikiParser = new WebInspector.WikiParser(testCases[i]); 25 var wikiParser = new WebInspector.WikiParser(testCases[i]);
22 InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r") + "\" is parsed"); 26 InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r") + "\" is parsed");
23 InspectorTest.addObject(wikiParser.document()); 27 InspectorTest.addObject(wikiParser.document());
24 } 28 }
25 next(); 29 next();
26 }, 30 },
27 31
28 function testJS(next) 32 function testJS(next)
29 { 33 {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 { 121 {
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"; 122 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); 123 var article = WebInspector.JSArticle.parse(jsMethodTest);
120 InspectorTest.addObject(article); 124 InspectorTest.addObject(article);
121 next(); 125 next();
122 }, 126 },
123 127
124 function testLinkWithoutSpace(next) 128 function testLinkWithoutSpace(next)
125 { 129 {
126 var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRO NG_LINK]]}}"; 130 var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRO NG_LINK]]}}";
127 var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest); 131 try {
128 InspectorTest.addObject(article); 132 var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest) ;
133 InspectorTest.addObject(article);
134 } catch (error) {
135 InspectorTest.addResult("Expected error: " + error);
136 }
129 next(); 137 next();
130 } 138 }
131 ]); 139 ]);
132 } 140 }
133
134 </script> 141 </script>
135 </head> 142 </head>
136 143
137 <body onload="runTest()"> 144 <body onload="runTest()">
138 145
139 </body> 146 </body>
140 </html> 147 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698