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

Unified Diff: LayoutTests/fast/domurl/url-pathname.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/domurl/url-pathname.html
diff --git a/LayoutTests/fast/domurl/url-pathname.html b/LayoutTests/fast/domurl/url-pathname.html
new file mode 100644
index 0000000000000000000000000000000000000000..323939ef7a0d9e4952015919e0713081e0e93317
--- /dev/null
+++ b/LayoutTests/fast/domurl/url-pathname.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<link rel="help" href="http://url.spec.whatwg.org/#dom-url-pathname">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+
+test(function() {
+ var url = new URL('http://www.domain.com/');
+ assert_equals(url.pathname, '/');
+
+ url = new URL('http://www.domain.com/a');
+ assert_equals(url.pathname, '/a');
+
+ url = new URL('http://www.domain.com');
+ assert_equals(url.pathname, '/');
+
+ url.pathname = 'a/b';
+ assert_equals(url.pathname, '/a/b');
+
+ url.pathname = 'a/b/';
+ assert_equals(url.pathname, '/a/b/');
+
+ url = new URL('file:///home/abarth');
+ assert_equals(url.pathname, '/home/abarth');
+}, 'Basic pathname');
+
+test(function() {
+ var url = new URL('mailto:foo@bar.com');
+ assert_equals(url.pathname, 'foo@bar.com');
+
+ url.pathname = '/a/b';
+ assert_equals(url.pathname, 'foo@bar.com');
+}, 'non hierarchical');
+
+test(function() {
+ var url = new URL('http://abc.de:8080/path/file?query#fragment');
+ url.href = 'invalid';
+ assert_equals(url.pathname, '');
+
+ url.pathname = '/new/path';
+ assert_equals(url.pathname, '');
+ assert_equals(url.href, 'invalid');
+}, 'pathname property invalid URL');
+
+</script>
« no previous file with comments | « LayoutTests/fast/domurl/url-password-expected.txt ('k') | LayoutTests/fast/domurl/url-pathname-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698