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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-has.html

Issue 1442643008: Implement 'URLSearchParams' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 <html>
3 <head>
4 <meta charset="utf8">
5 <link rel="help" href="http://url.spec.whatwg.org/#dom-urlsearchparams-has">
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 <script src="resources/testharness-extras.js"></script>
9 <script>
10 test(function() {
11 var params = new URLSearchParams('a=b&c=d');
12 assert_true(params.has('a'));
13 assert_true(params.has('c'));
14 assert_false(params.has('e'));
15 params = new URLSearchParams('a=b&c=d&a=e');
16 assert_true(params.has('a'));
17 params = new URLSearchParams('=b&c=d');
18 assert_true(params.has(''));
19 params = new URLSearchParams('null=a');
20 assert_true(params.has(null));
21 }, 'Has basics');
22
23 test(function() {
24 var params = new URLSearchParams('a=b&c=d&&');
25 params.append('first', 1);
26 params.append('first', 2);
27 assert_true(params.has('a'), 'Search params object has name "a"');
28 assert_true(params.has('c'), 'Search params object has name "c"');
29 assert_true(params.has('first'), 'Search params object has name "first"');
30 assert_false(params.has('d'), 'Search params object has no name "d"');
31 params.delete('first');
32 assert_false(params.has('first'), 'Search params object has no name "first"' );
33 }, 'has() following delete()');
34 </script>
35 </head>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698