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

Side by Side Diff: LayoutTests/fast/domurl/url-hash.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-hash"> 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-hash">
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.hash, ''); 9 assert_equals(url.hash, '');
10 10
11 url = new URL('http://www.domain.com/#'); 11 url = new URL('http://www.domain.com/#');
12 assert_equals(url.hash, ''); 12 assert_equals(url.hash, '');
13 13
14 url = new URL('http://www.domain.com/#a'); 14 url = new URL('http://www.domain.com/#a');
15 assert_equals(url.hash, '#a'); 15 assert_equals(url.hash, '#a');
16 16
17 url.hash = ''; 17 url.hash = '';
18 assert_equals(url.hash, ''); 18 assert_equals(url.hash, '');
19 assert_equals(url.toString(), 'http://www.domain.com/');
19 20
20 url.hash = '#'; 21 url.hash = '#';
21 assert_equals(url.hash, ''); 22 assert_equals(url.hash, '');
23 assert_equals(url.toString(), 'http://www.domain.com/');
22 24
23 url.hash = 'a'; 25 url.hash = 'a';
24 assert_equals(url.hash, '#a'); 26 assert_equals(url.hash, '#a');
25 27
26 url.hash = '#a'; 28 url.hash = '#a';
27 assert_equals(url.hash, '#a'); 29 assert_equals(url.hash, '#a');
28 30
29 url.hash = 'a#b'; 31 url.hash = 'a#b';
30 assert_equals(url.hash, '#a#b'); 32 assert_equals(url.hash, '#a#b');
31 }, 'Basic hash'); 33 }, 'Basic hash');
(...skipping 18 matching lines...) Expand all
50 52
51 test(function() { 53 test(function() {
52 var url = new URL('http://www.domain.com/'); 54 var url = new URL('http://www.domain.com/');
53 assert_equals(url.hash, ''); 55 assert_equals(url.hash, '');
54 56
55 url.hash = '\udc01\ud802a'; 57 url.hash = '\udc01\ud802a';
56 assert_equals(url.hash, '#\ufffd\ufffda'); 58 assert_equals(url.hash, '#\ufffd\ufffda');
57 }, 'hash with unmatched surrogates'); 59 }, 'hash with unmatched surrogates');
58 60
59 </script> 61 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/location-hash-expected.txt ('k') | LayoutTests/fast/domurl/url-search.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698