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

Unified Diff: LayoutTests/fast/domurl/url-query-parse.html

Issue 141003005: Old CL related to URL query (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | « LayoutTests/fast/domurl/url-query-has.html ('k') | LayoutTests/fast/domurl/url-query-serialize.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/domurl/url-query-parse.html
diff --git a/LayoutTests/fast/domurl/url-query-parse.html b/LayoutTests/fast/domurl/url-query-parse.html
new file mode 100644
index 0000000000000000000000000000000000000000..287e888e268d7a02d93a342349e6ff89f2be89f2
--- /dev/null
+++ b/LayoutTests/fast/domurl/url-query-parse.html
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<link rel="help" href="http://url.spec.whatwg.org/#interface-urlquery">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+
+test(function() {
+ var q = new URLQuery('a=b+c');
+ assert_equals(q.get('a'), 'b c');
+
+ q = new URLQuery('a+b=c');
+ assert_equals(q.get('a b'), 'c');
+}, 'Parse +');
+
+test(function() {
+ var q = new URLQuery('a=b c');
+ assert_equals(q.get('a'), 'b c');
+
+ q = new URLQuery('a b=c');
+ assert_equals(q.get('a b'), 'c');
+}, 'Parse space');
+
+test(function() {
+ var q = new URLQuery('a=b%20c');
+ assert_equals(q.get('a'), 'b c');
+
+ q = new URLQuery('a%20b=c');
+ assert_equals(q.get('a b'), 'c');
+}, 'Parse %20');
+
+test(function() {
+ var q = new URLQuery('a=b\0c');
+ assert_equals(q.get('a'), 'b\0c');
+
+ q = new URLQuery('a\0b=c');
+ assert_equals(q.get('a\0b'), 'c');
+}, 'Parse \\0');
+
+test(function() {
+ var q = new URLQuery('a=b%00c');
+ assert_equals(q.get('a'), 'b\0c');
+
+ q = new URLQuery('a%00b=c');
+ assert_equals(q.get('a\0b'), 'c');
+}, 'Parse %00');
+
+test(function() {
+ var q = new URLQuery('a=b\uD83D\uDCA9c');
+ assert_equals(q.get('a'), 'b\uD83D\uDCA9c');
+
+ q = new URLQuery('a\uD83D\uDCA9b=c');
+ assert_equals(q.get('a\uD83D\uDCA9b'), 'c');
+}, 'Parse \uD83D\uDCA9'); // Unicode Character 'PILE OF POO' (U+1F4A9)
+
+test(function() {
+ var q = new URLQuery('a=b%f0%9f%92%a9c');
+ assert_equals(q.get('a'), 'b\uD83D\uDCA9c');
+
+ q = new URLQuery('a%f0%9f%92%a9b=c');
+ assert_equals(q.get('a\uD83D\uDCA9b'), 'c');
+}, 'Parse %f0%9f%92%a9'); // Unicode Character 'PILE OF POO' (U+1F4A9)
+
+</script>
« no previous file with comments | « LayoutTests/fast/domurl/url-query-has.html ('k') | LayoutTests/fast/domurl/url-query-serialize.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698