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

Side by Side Diff: LayoutTests/fast/domurl/url-searchparams-delete.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-delete">
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.delete("a");
9 assert_equals(params + "", "c=d");
10 params = new URLSearchParams("a=a&b=b&a=a&c=c");
11 params.delete("a");
12 assert_equals(params + "", "b=b&c=c");
13 params = new URLSearchParams("a=a&=&b=b&c=c");
14 params.delete("");
15 assert_equals(params + "", "a=a&b=b&c=c");
16 params = new URLSearchParams("a=a&null=null&b=b");
17 params.delete(null);
18 assert_equals(params + "", "a=a&b=b");
19 params = new URLSearchParams("a=a&undefined=undefined&b=b");
20 params.delete(undefined);
21 assert_equals(params + "", "a=a&b=b");
22 }, "Delete basics");
23
24 test(function() {
25 var params = new URLSearchParams();
26 params.append("first", 1);
27 assert_true(params.has("first"), "Search params object has name 'first'");
28 assert_equals(params.get("first"), "1", "Search params object has name 'firs t' with value '1'");
29 params.delete("first");
30 assert_false(params.has("first"), "Search params object has no 'first' name" );
31 params.append("first", 1);
32 params.append("first", 10);
33 params.delete("first");
34 assert_false(params.has("first"), "Search params object has no 'first' name" );
35 }, "Deleting appended multiple");
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698