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

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

Issue 24066010: Implement URLUtils and URL interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates based on code review comments Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-hash">
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 test(function() {
8 var url = new URL('http://www.domain.com/');
9 assert_equals(url.hash, '');
10
11 url = new URL('http://www.domain.com/#');
12 assert_equals(url.hash, '');
13
14 url = new URL('http://www.domain.com/#a');
15 assert_equals(url.hash, '#a');
16
17 url.hash = '';
18 assert_equals(url.hash, '');
19
20 url.hash = '#';
21 assert_equals(url.hash, '');
22
23 url.hash = 'a';
24 assert_equals(url.hash, '#a');
25
26 url.hash = '#a';
27 assert_equals(url.hash, '#a');
28
29 url.hash = 'a#b';
30 assert_equals(url.hash, '#a#b');
31 }, 'Basic hash');
32
33 test(function() {
34 var url = new URL('mailto:foo@bar.com');
35 assert_equals(url.hash, '');
36
37 url.hash = 'a';
38 assert_equals(url.hash, '');
39 }, 'non hierarchical');
40
41 test(function() {
42 var url = new URL('http://abc.de:8080/path/file?query#fragment');
43 url.href = 'invalid';
44 assert_equals(url.hash, '');
45
46 url.hash = 'changed';
47 assert_equals(url.hash, '');
48 assert_equals(url.href, 'invalid');
49 }, 'hash property invalid URL');
50
51 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/domurl/url-constructor-expected.txt ('k') | LayoutTests/fast/domurl/url-hash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698