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

Unified Diff: tests/standalone/io/directory_error_test.dart

Issue 11558012: Use FormatMessageW for Windows error messages to handle internationalized messages correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years 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 | « runtime/bin/utils_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/directory_error_test.dart
diff --git a/tests/standalone/io/directory_error_test.dart b/tests/standalone/io/directory_error_test.dart
index cf90f91f149fff0ff87d63d5699869816560efb3..fecb2231863f7d83feaafe508ccf1b46594b24ad 100644
--- a/tests/standalone/io/directory_error_test.dart
+++ b/tests/standalone/io/directory_error_test.dart
@@ -17,15 +17,10 @@ bool checkCreateInNonExistentFileException(e) {
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Creation failed") != -1);
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") {
- Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
Expect.equals(2, e.osError.errorCode);
} else if (Platform.operatingSystem == "windows") {
- Expect.isTrue(
- e.toString().indexOf(
- "The system cannot find the path specified") != -1);
Expect.equals(3, e.osError.errorCode);
}
@@ -49,18 +44,11 @@ void testCreateInNonExistent(Directory temp, Function done) {
bool checkCreateTempInNonExistentFileException(e) {
Expect.isTrue(e is DirectoryIOException);
Expect.isTrue(e.osError != null);
- Expect.isTrue(e.toString().indexOf(
- "Creation of temporary directory failed") != -1);
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") {
- Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
Expect.equals(2, e.osError.errorCode);
} else if (Platform.operatingSystem == "windows") {
- Expect.isTrue(
- e.toString().indexOf(
- "The system cannot find the path specified") != -1);
Expect.equals(3, e.osError.errorCode);
}
@@ -84,16 +72,6 @@ void testCreateTempInNonExistent(Directory temp, Function done) {
bool checkDeleteNonExistentFileException(e) {
Expect.isTrue(e is DirectoryIOException);
Expect.isTrue(e.osError != null);
- Expect.isTrue(e.toString().indexOf("Deletion failed") != -1);
- if (Platform.operatingSystem == "linux") {
- Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (Platform.operatingSystem == "macos") {
- Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
- } else if (Platform.operatingSystem == "windows") {
- Expect.isTrue(
- e.toString().indexOf(
- "The system cannot find the file specified") != -1);
- }
// File not not found has error code 2 on all supported platforms.
Expect.equals(2, e.osError.errorCode);
@@ -119,15 +97,10 @@ bool checkDeleteRecursivelyNonExistentFileException(e) {
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Deletion failed") != -1);
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") {
- Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
Expect.equals(2, e.osError.errorCode);
} else if (Platform.operatingSystem == "windows") {
- Expect.isTrue(
- e.toString().indexOf(
- "The system cannot find the path specified") != -1);
Expect.equals(3, e.osError.errorCode);
}
@@ -153,15 +126,10 @@ bool checkListNonExistentFileException(e) {
Expect.isTrue(e.osError != null);
Expect.isTrue(e.toString().indexOf("Directory listing failed") != -1);
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") {
- Expect.isTrue(e.toString().indexOf("No such file or directory") != -1);
Expect.equals(2, e.osError.errorCode);
} else if (Platform.operatingSystem == "windows") {
- Expect.isTrue(
- e.toString().indexOf(
- "The system cannot find the path specified") != -1);
Expect.equals(3, e.osError.errorCode);
}
« no previous file with comments | « runtime/bin/utils_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698