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

Side by Side Diff: LayoutTests/fast/domurl/url-search.html

Issue 537103002: Spec compliant url.search/url.hash setters over empty values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Sync expected output Created 6 years, 3 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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-search"> 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-search">
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 6
7 test(function() { 7 test(function() {
8 var url = new URL('http://www.domain.com/'); 8 var url = new URL('http://www.domain.com/');
9 assert_equals(url.search, ''); 9 assert_equals(url.search, '');
10 10
11 url = new URL('http://www.domain.com/?'); 11 url = new URL('http://www.domain.com/?');
12 assert_equals(url.search, ''); 12 assert_equals(url.search, '');
13 13
14 url = new URL('http://www.domain.com/?a'); 14 url = new URL('http://www.domain.com/?a');
15 assert_equals(url.search, '?a'); 15 assert_equals(url.search, '?a');
16 16
17 url.search = ''; 17 url.search = '';
18 assert_equals(url.search, ''); 18 assert_equals(url.search, '');
19 assert_equals(url.toString(), 'http://www.domain.com/');
19 20
20 url.search = '?'; 21 url.search = '?';
21 assert_equals(url.search, ''); 22 assert_equals(url.search, '');
23 assert_equals(url.toString(), 'http://www.domain.com/');
22 24
23 url.search = 'a'; 25 url.search = 'a';
24 assert_equals(url.search, '?a'); 26 assert_equals(url.search, '?a');
25 27
26 url.search = '?a'; 28 url.search = '?a';
27 assert_equals(url.search, '?a'); 29 assert_equals(url.search, '?a');
28 30
29 url.search = 'a#b'; 31 url.search = 'a#b';
30 assert_equals(url.search, '?a%23b'); 32 assert_equals(url.search, '?a%23b');
31 33
(...skipping 13 matching lines...) Expand all
45 var url = new URL('http://abc.de:8080/path/file?query#fragment'); 47 var url = new URL('http://abc.de:8080/path/file?query#fragment');
46 url.href = 'invalid'; 48 url.href = 'invalid';
47 assert_equals(url.search, ''); 49 assert_equals(url.search, '');
48 50
49 url.search = 'changed'; 51 url.search = 'changed';
50 assert_equals(url.search, ''); 52 assert_equals(url.search, '');
51 assert_equals(url.href, 'invalid'); 53 assert_equals(url.href, 'invalid');
52 }, 'search property invalid URL'); 54 }, 'search property invalid URL');
53 55
54 </script> 56 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698