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

Unified Diff: LayoutTests/fast/domurl/url-port.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
« no previous file with comments | « LayoutTests/fast/domurl/url-pathname-expected.txt ('k') | LayoutTests/fast/domurl/url-port-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/domurl/url-port.html
diff --git a/LayoutTests/fast/domurl/url-port.html b/LayoutTests/fast/domurl/url-port.html
new file mode 100644
index 0000000000000000000000000000000000000000..eb7a59df9b173d3648ae1ee2df6c7e89f1d5e56d
--- /dev/null
+++ b/LayoutTests/fast/domurl/url-port.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<link rel="help" href="http://url.spec.whatwg.org/#dom-url-port">
+<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.port, '');
+
+ url = new URL('http://www.domain.com:8080/');
+ assert_equals(url.port, '8080');
+
+ url.port = 8081;
+ assert_equals(url.port, '8081');
+
+ url.port = '';
+ assert_equals(url.port, '0');
+
+ url.port = 80;
+ assert_equals(url.port, '');
+
+ url.port = 0;
+ assert_equals(url.port, '0');
+}, 'Basic port');
+
+test(function() {
+ var url = new URL('mailto:foo@bar.com');
+ assert_equals(url.port, '');
+
+ url = new URL('file:///home/abarth');
+ assert_equals(url.port, '');
+}, 'no port');
+
+test(function() {
+ var url = new URL('http://abc.de:8080/path/file?query#fragment');
+ url.href = 'invalid';
+ assert_equals(url.port, '');
+
+ url.port = '8081';
+ assert_equals(url.port, '');
+ assert_equals(url.href, 'invalid');
+}, 'port property invalid URL');
+
+</script>
« no previous file with comments | « LayoutTests/fast/domurl/url-pathname-expected.txt ('k') | LayoutTests/fast/domurl/url-port-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698