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

Side by Side Diff: LayoutTests/fast/domurl/url-username.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-username">
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.username, '');
10
11 url = new URL('http://user@www.domain.com/');
12 assert_equals(url.username, 'user');
13
14 url.username = 'changed';
15 assert_equals(url.toString(), 'http://changed@www.domain.com/');
16
17 url.username = '';
18 assert_equals(url.toString(), 'http://www.domain.com/');
19 }, 'username property');
20
21 test(function() {
22 var url = new URL('about:test');
23 assert_equals(url.username, '');
24
25 url.username = 'user';
26 assert_equals(url.username, '');
27 assert_equals(url.toString(), 'about:test');
28 }, 'username property on non relative URL');
29
30 test(function() {
31 var url = new URL('http://www.domain.com/');
32 url.href = 'invalid';
33 assert_equals(url.username, '');
34
35 url.username = 'changed';
36 assert_equals(url.username, '');
37 assert_equals(url.href, 'invalid');
38 }, 'username property invalid URL');
39
40 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/domurl/url-search-expected.txt ('k') | LayoutTests/fast/domurl/url-username-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698