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

Unified 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: add method secondToken() 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/documentation/document-parser.html
diff --git a/LayoutTests/inspector/documentation/document-parser.html b/LayoutTests/inspector/documentation/document-parser.html
index cae3d0400e0e5f615f80af2e2e771dd3cb5fdb5f..6b035a795845b0718328553bb1a7f33163f0444c 100644
--- a/LayoutTests/inspector/documentation/document-parser.html
+++ b/LayoutTests/inspector/documentation/document-parser.html
@@ -11,12 +11,15 @@ function test()
function testWikiParser(next)
{
var testCases = [
+ "{{A|Code= var nod{{=}}document.createElement(\"li\");\ndocument.getElementById(\"oUL1\").insertBefore(nod, document.getElementById(\"oLIYellow\"));\nnod.textContet{{=}}\"Orange\"}}",
+ "{{A|Code={{=}} }}",
+ "{{A|B=C}}",
"{{A|B={{C|D=blablabla}}}}",
- "{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n|Description=[[css/color|CSS color value]]}}\n}}",
+ "{{A|B={{C|D=bla}}|x=y}}",
+ "{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n|Description= [[css/color|CSS color value]]}}\n}}",
"{{A}}",
- "{{A|B=bla<a=c>bla}}",
- "{{A}}",
- "{{AbC|xyz \n \t \r}}"];
+ "{{A|B= [[google.com{{!}}Google]]}}",
+ "{{AbC|xyz \n\t \r}}"];
for (var i = 0; i < testCases.length; i++) {
var wikiParser = new WebInspector.WikiParser(testCases[i]);
InspectorTest.addResult("\"" + testCases[i].replace("\r", "\\r") + "\" is parsed");
@@ -108,6 +111,7 @@ function test()
function testExamples(next)
{
var examplesTest = "{{Examples_Section\n|Not_required=No\n|Examples={{Single Example\n|Language=HTML\n|Description=The following example shows how to use the '''insertBefore''' method to insert a new item into an existing list.\n|Code=&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;script type{{=}}\"application/javascript\"&gt;\n function insertElement()\n {\n var nod{{=}}document.createElement(\"li\");\n document.getElementById(\"oUL1\").insertBefore(nod, document.getElementById(\"oLIYellow\"));\n nod.textContet{{=}}\"Orange\";\n }\n&lt;/script&gt;\n&lt;/head&gt;\n&lt;body&gt;\n &lt;p onclick{{=}}\"insertElement()\"&gt;Click &lt;strong&gt;HERE&lt;/strong&gt; to add an item to the following list.&lt;/p&gt;\n &lt;ul id{{=}}\"oUL1\"&gt;\n &lt;li id{{=}}\"oLIRed\"&gt;Red&lt;/li&gt;\n &lt;li id{{=}}\"oLIYellow\"&gt;Yellow&lt;/li&gt;\n &lt;li id{{=}}\"oLIBlue\"&gt;Blue&lt;/li&gt;\n &lt;/ul&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n|LiveURL=http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/insertBefore.htm\n}}\n}}";
+ debugger;
lushnikov 2014/09/08 14:08:29 remove
iliia 2014/09/08 15:20:49 Done.
var article = WebInspector.JSArticle.parse(examplesTest);
InspectorTest.addObject(article);
next();
@@ -124,13 +128,16 @@ function test()
function testLinkWithoutSpace(next)
{
var linkWithoutSpaceTest = "{{Summary_Section|[[http://wrong.com|WRONG_LINK]]}}";
- var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest);
- InspectorTest.addObject(article);
+ try {
+ var article = WebInspector.JSArticle.parse(linkWithoutSpaceTest);
+ InspectorTest.addObject(article);
+ } catch (error) {
+ InspectorTest.addResult(error);
lushnikov 2014/09/08 14:08:29 prepend with "Expected error: "
iliia 2014/09/08 15:20:49 Done.
+ }
next();
}
]);
}
-
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698