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

Side by Side Diff: LayoutTests/fast/domurl/url-searchparams-get.html

Issue 143313002: Implement URLSearchParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More tests + ref count unattached URLSearchParams objects 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-urlsearchparams-get">
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6 test(function() {
7 var params = new URLSearchParams("a=b&c=d");
8 assert_equals(params.get("a"), "b");
9 assert_equals(params.get("c"), "d");
10 assert_equals(params.get("e"), null);
11 params = new URLSearchParams("a=b&c=d&a=e");
12 assert_equals(params.get("a"), "b");
13 params = new URLSearchParams("=b&c=d");
14 assert_equals(params.get(""), "b");
15 params = new URLSearchParams("a=&c=d&a=e");
16 assert_equals(params.get("a"), "");
17 }, "Get basics");
18
19 test(function() {
20 var params = new URLSearchParams("first=second&third&&");
21 assert_true(params != null, "constructor returned non-null value.");
22 assert_true(params.has("first"), "Search params object has name 'first'");
23 assert_equals(params.get("first"), "second", "Search params object has name 'first' with value 'second'");
24 assert_equals(params.get("third"), "", "Search params object has name 'third ' with the empty value.");
25 assert_equals(params.get("fourth"), null, "Search params object has no 'four th' name and value.");
26 }, "More get() basics");
27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698