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

Unified Diff: LayoutTests/fast/domurl/url-search.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/domurl/url-search.html
diff --git a/LayoutTests/fast/domurl/url-search.html b/LayoutTests/fast/domurl/url-search.html
index 9aeb0c580c81e89ceada1249ed885c33ebc43096..b38964e589e7145f881ccb70f2d119384b81533a 100644
--- a/LayoutTests/fast/domurl/url-search.html
+++ b/LayoutTests/fast/domurl/url-search.html
@@ -3,7 +3,6 @@
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
-
test(function() {
var url = new URL('http://www.domain.com/');
assert_equals(url.search, '');
@@ -51,4 +50,22 @@ test(function() {
assert_equals(url.href, 'invalid');
}, 'search property invalid URL');
+test(function() {
+ var url = new URL('http://example.org/file?a=b&c=d');
+ var searchParams = url.searchParams;
+ assert_true(searchParams != null);
+ assert_equals(searchParams.toString(), "a=b&c=d");
+
+ url.search = 'e=f&g=h';
+ assert_equals(searchParams.toString(), "e=f&g=h");
+
+ searchParams.append('i', ' j ');
+ assert_equals(url.search, "?e=f&g=h&i=+j+");
+
+ searchParams.set('e', 'updated');
+ assert_equals(url.search, "?e=updated&g=h&i=+j+");
+
+ assert_throws({name: "TypeError"}, function() { url.searchParams = {}; });
+
+}, 'search and searchParams');
</script>

Powered by Google App Engine
This is Rietveld 408576698