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

Unified Diff: tests/utils/uri_test.dart

Issue 12052038: Rename new Uri.fromString to Uri.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload because of Error. Created 7 years, 11 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 | « tests/standalone/io/web_socket_test.dart ('k') | utils/pub/command_lish.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/utils/uri_test.dart
diff --git a/tests/utils/uri_test.dart b/tests/utils/uri_test.dart
index d72b30844a4354ded3b3083df1a0240b2fffa87b..2aa688e9948ec1371d6b68e4484b22a174c8aafd 100644
--- a/tests/utils/uri_test.dart
+++ b/tests/utils/uri_test.dart
@@ -8,9 +8,9 @@ import 'dart:utf';
import 'dart:uri';
testUri(String uri, bool isAbsolute) {
- Expect.equals(isAbsolute, new Uri.fromString(uri).isAbsolute());
+ Expect.equals(isAbsolute, Uri.parse(uri).isAbsolute());
Expect.equals(isAbsolute, new Uri(uri).isAbsolute());
- Expect.stringEquals(uri, new Uri.fromString(uri).toString());
+ Expect.stringEquals(uri, Uri.parse(uri).toString());
Expect.stringEquals(uri, new Uri(uri).toString());
// Test equals and hashCode members.
@@ -113,7 +113,7 @@ main() {
path: "/a/b/c/",
query: null,
fragment: null).toString());
- Expect.stringEquals("file://", new Uri.fromString("file:").toString());
+ Expect.stringEquals("file://", Uri.parse("file:").toString());
Expect.stringEquals("file://", new Uri("file:").toString());
Expect.stringEquals("/a/g", removeDotSegments("/a/b/c/./../../g"));
Expect.stringEquals("mid/6", removeDotSegments("mid/content=5/../6"));
@@ -127,25 +127,25 @@ main() {
Expect.stringEquals("a/b/e/", removeDotSegments("./a/b/./c/d/../../e/././."));
final urisSample = "http://a/b/c/d;p?q";
- Uri baseFromString = new Uri.fromString(urisSample);
+ Uri baseFromString = Uri.parse(urisSample);
testUriPerRFCs(baseFromString);
Uri base = new Uri(urisSample);
testUriPerRFCs(base);
Expect.stringEquals(
"http://example.com",
- new Uri.fromString("http://example.com/a/b/c").origin);
+ Uri.parse("http://example.com/a/b/c").origin);
Expect.stringEquals(
"https://example.com",
- new Uri.fromString("https://example.com/a/b/c").origin);
+ Uri.parse("https://example.com/a/b/c").origin);
Expect.stringEquals(
"http://example.com:1234",
- new Uri.fromString("http://example.com:1234/a/b/c").origin);
+ Uri.parse("http://example.com:1234/a/b/c").origin);
Expect.stringEquals(
"https://example.com:1234",
- new Uri.fromString("https://example.com:1234/a/b/c").origin);
+ Uri.parse("https://example.com:1234/a/b/c").origin);
Expect.throws(
- () => new Uri.fromString("http:").origin,
+ () => Uri.parse("http:").origin,
(e) { return e is ArgumentError; },
"origin for uri with empty domain should fail");
Expect.throws(
@@ -182,11 +182,11 @@ main() {
(e) { return e is ArgumentError; },
"origin for uri with empty domain should fail");
Expect.throws(
- () => new Uri.fromString("http://:80").origin,
+ () => Uri.parse("http://:80").origin,
(e) { return e is ArgumentError; },
"origin for uri with empty domain should fail");
Expect.throws(
- () => new Uri.fromString("file://localhost/test.txt").origin,
+ () => Uri.parse("file://localhost/test.txt").origin,
(e) { return e is ArgumentError; },
"origin for non-http/https uri should fail");
« no previous file with comments | « tests/standalone/io/web_socket_test.dart ('k') | utils/pub/command_lish.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698