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

Side by Side Diff: LayoutTests/fast/domurl/url-searchparams-set.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/#interface-urlsearchparams-set ">
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 params.set("a", "B");
9 assert_equals(params + "", "a=B&c=d");
10 params = new URLSearchParams("a=b&c=d&a=e");
11 params.set("a", "B");
12 assert_equals(params + "", "a=B&c=d")
13 params.set("e", "f");
14 assert_equals(params + "", "a=B&c=d&e=f")
15 }, "Set basics");
16
17 test(function() {
18 var params = new URLSearchParams("a=1&a=2&a=3");
19 assert_true(params.has("a"), "Search params object has name 'a'");
20 assert_equals(params.get("a"), "1", "Search params object has name 'a' with value '1'");
21 params.set("first", 4);
22 assert_true(params.has("a"), "Search params object has name 'a'");
23 assert_equals(params.get("a"), "1", "Search params object has name 'a' with value '1'");
24 params.set("a", 4);
25 assert_true(params.has("a"), "Search params object has name 'a'");
26 assert_equals(params.get("a"), "4", "Search params object has name 'a' with value '4'");
27 }, "URLSearchParams.set");
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698