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

Unified Diff: tests/standalone/src/io/DirectoryErrorTest.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/DartStdIOPipeTest.dart ('k') | tests/standalone/src/io/DirectoryTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/DirectoryErrorTest.dart
diff --git a/tests/standalone/src/io/DirectoryErrorTest.dart b/tests/standalone/src/io/DirectoryErrorTest.dart
index 1623dad25fe66b082789219bb103b7568c075cc6..ed13aac50ac7ff8296d08fbd17d0d9e80fb51f0f 100644
--- a/tests/standalone/src/io/DirectoryErrorTest.dart
+++ b/tests/standalone/src/io/DirectoryErrorTest.dart
@@ -18,14 +18,13 @@ bool checkCreateInNonExistentFileException(e) {
Expect.isTrue(e is DirectoryIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Creation failed") != -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);
@@ -54,14 +53,13 @@ bool checkCreateTempInNonExistentFileException(e) {
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf(
"Creation of temporary directory failed") != -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);
@@ -89,12 +87,11 @@ bool checkDeleteNonExistentFileException(e) {
Expect.isTrue(e is DirectoryIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Deletion failed") != -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);
@@ -123,14 +120,13 @@ bool checkDeleteRecursivelyNonExistentFileException(e) {
Expect.isTrue(e is DirectoryIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Deletion failed") != -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,14 +154,13 @@ bool checkListNonExistentFileException(e) {
Expect.isTrue(e is DirectoryIOException);
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Directory listing failed") != -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);
« no previous file with comments | « tests/standalone/src/io/DartStdIOPipeTest.dart ('k') | tests/standalone/src/io/DirectoryTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698