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

Side by Side Diff: LayoutTests/fast/domurl/url-origin.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-origin">
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 function assertOrigin(url, expectedOrigin) {
8 var url = new URL(url);
9 assert_equals(url.origin, expectedOrigin);
10 }
11
12 test(function() {
13 assertOrigin('http://example.com/foo/bar', 'http://example.com');
14 assertOrigin('HTTP://example.com/foo/bar', 'http://example.com');
15 assertOrigin('https://example.com/ttt?ggg', 'https://example.com');
16 assertOrigin('ftp://example.com/ttt?ggg', 'ftp://example.com');
17 assertOrigin('file:///home/abarth', 'file://');
18
19 // The following are implementation specific.
20 assertOrigin('data:text/html,<b>foo</b>', 'null');
21 assertOrigin('about:blank', 'null');
22 }, 'origin property');
23
24 test(function() {
25 var url = new URL('http://www.domain.com/');
26 url.origin = 'changed'; // readonly
27 assert_equals(url.origin, 'http://www.domain.com');
28 }, 'origin property is readonly');
29
30 test(function() {
31 var url = new URL('http://www.domain.com/');
32 url.href = 'invalid';
33 assert_equals(url.origin, '');
34 }, 'origin property invalid URL');
35
36 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/domurl/url-href-expected.txt ('k') | LayoutTests/fast/domurl/url-origin-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698