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> |