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

Unified Diff: third_party/WebKit/LayoutTests/fast/xsl/xslt-translate.html

Issue 1897383004: Added XSLT translate test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/xsl/xslt-translate-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/xsl/xslt-translate.html
diff --git a/third_party/WebKit/LayoutTests/fast/xsl/xslt-translate.html b/third_party/WebKit/LayoutTests/fast/xsl/xslt-translate.html
new file mode 100644
index 0000000000000000000000000000000000000000..8e7a5573d8cacbe6ad17820b5aff5aea62d6d801
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/xsl/xslt-translate.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script>
+description("Must not crash, and transforms to 'Simple_sting_line'. Test for http://crbug.com/599427.");
+
+var stylesheetXml =
+ '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">' +
+ '<xsl:template match="/">' +
+ '<div>' +
+ '<xsl:value-of select=\'translate("Simple sting line"," ","_")\'/>' +
+ '</div>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>';
+
+var parser = new DOMParser();
+var doc = parser.parseFromString(stylesheetXml, 'text/xml');
+var xslt = parser.parseFromString(stylesheetXml, 'text/xml');
+var processor = new XSLTProcessor();
+processor.importStylesheet(xslt);
+
+shouldBe('processor.transformToFragment(doc, document).textContent', '"Simple_sting_line"');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/xsl/xslt-translate-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698