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

Side by Side Diff: LayoutTests/fast/domurl/url-searchparams-has.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-has ">
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_true(params.has("a"));
9 assert_true(params.has("c"));
10 assert_false(params.has("e"));
11 params = new URLSearchParams("a=b&c=d&a=e");
12 assert_true(params.has("a"));
13 params = new URLSearchParams("=b&c=d");
14 assert_true(params.has(""));
15 params = new URLSearchParams("null=a");
16 assert_true(params.has(null));
17 }, "Has basics");
18
19 test(function() {
20 var params = new URLSearchParams("a=b&c=d&&");
21 params.append("first", 1);
22 params.append("first", 2);
23 assert_true(params.has("a"), "Search params object has name 'a'");
24 assert_true(params.has("c"), "Search params object has name 'c'");
25 assert_true(params.has("first"), "Search params object has name 'first'");
26 assert_false(params.has("d"), "Search params object has no name 'd'");
27 params.delete("first");
28 assert_false(params.has("first"), "Search params object has no name 'first'" );
29 }, "has() following delete()");
30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698