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

Unified Diff: tests/standalone/src/io/FileErrorTest.dart

Issue 10021048: Remove need to instantiate Platform and make methods static. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add stable test binaries. Created 8 years, 8 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/src/io/DirectoryTest.dart ('k') | tests/standalone/src/io/PlatformTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/FileErrorTest.dart
diff --git a/tests/standalone/src/io/FileErrorTest.dart b/tests/standalone/src/io/FileErrorTest.dart
index 295dfbc7d544efe86f89c093854cd000df572f00..40f2b62c9b3b2cfb7c4a05c7efecd16e7b0683f7 100644
--- a/tests/standalone/src/io/FileErrorTest.dart
+++ b/tests/standalone/src/io/FileErrorTest.dart
@@ -18,12 +18,11 @@ bool checkNonExistentFileException(e, str) {
Expect.isTrue(e is FileIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf(str) != -1);
- Platform platform = new Platform();
- if (platform.operatingSystem() == "linux") {
+ if (Platform.operatingSystem() == "linux") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (platform.operatingSystem() == "macos") {
+ } else if (Platform.operatingSystem() == "macos") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (platform.operatingSystem() == "windows") {
+ } else if (Platform.operatingSystem() == "windows") {
Expect.isTrue(
e.toString().indexOf(
"The system cannot find the file specified") != -1);
@@ -117,14 +116,13 @@ bool checkCreateInNonExistentDirectoryException(e) {
Expect.isTrue(e is FileIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Cannot create file") != -1);
- Platform platform = new Platform();
- if (platform.operatingSystem() == "linux") {
+ if (Platform.operatingSystem() == "linux") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
Expect.equals(2, e.osError.errorCode);
- } else if (platform.operatingSystem() == "macos") {
+ } else if (Platform.operatingSystem() == "macos") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
Expect.equals(2, e.osError.errorCode);
- } else if (platform.operatingSystem() == "windows") {
+ } else if (Platform.operatingSystem() == "windows") {
Expect.isTrue(
e.toString().indexOf(
"The system cannot find the path specified") != -1);
@@ -158,12 +156,11 @@ bool checkFullPathOnNonExistentDirectoryException(e) {
Expect.isTrue(e is FileIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Cannot retrieve full path") != -1);
- Platform platform = new Platform();
- if (platform.operatingSystem() == "linux") {
+ if (Platform.operatingSystem() == "linux") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (platform.operatingSystem() == "macos") {
+ } else if (Platform.operatingSystem() == "macos") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (platform.operatingSystem() == "windows") {
+ } else if (Platform.operatingSystem() == "windows") {
Expect.isTrue(
e.toString().indexOf(
"The system cannot find the file specified") != -1);
@@ -199,12 +196,11 @@ bool checkDirectoryInNonExistentDirectoryException(e) {
Expect.isTrue(e.osError != null);
Expect.isTrue(
e.toString().indexOf("Cannot retrieve directory for file") != -1);
- Platform platform = new Platform();
- if (platform.operatingSystem() == "linux") {
+ if (Platform.operatingSystem() == "linux") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (platform.operatingSystem() == "macos") {
+ } else if (Platform.operatingSystem() == "macos") {
Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (platform.operatingSystem() == "windows") {
+ } else if (Platform.operatingSystem() == "windows") {
Expect.isTrue(
e.toString().indexOf(
"The system cannot find the file specified") != -1);
« no previous file with comments | « tests/standalone/src/io/DirectoryTest.dart ('k') | tests/standalone/src/io/PlatformTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698