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

Unified Diff: tests/standalone/src/FileTest.dart

Issue 9535004: Another attempt to fix flaky test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileTest.dart
diff --git a/tests/standalone/src/FileTest.dart b/tests/standalone/src/FileTest.dart
index 2ce8ac4a2b44f1b2acc84b210f3e9aa3084e5647..f2ca38d7b2fd52092d1f997b69eeff070d422cbe 100644
--- a/tests/standalone/src/FileTest.dart
+++ b/tests/standalone/src/FileTest.dart
@@ -122,18 +122,19 @@ class FileTest {
Expect.equals(false, writeDone);
output.noPendingWriteHandler = () {
output.close();
-
- // Now read the contents of the file just written.
- List<int> buffer2 = new List<int>(42);
- file = new File(outFilename);
- input = file.openInputStream();
- input.dataHandler = () {
- bytesRead = input.readInto(buffer2, 0, 42);
- Expect.equals(42, bytesRead);
- // Now compare the two buffers to check if they are identical.
- for (int i = 0; i < buffer1.length; i++) {
- Expect.equals(buffer1[i], buffer2[i]);
- }
+ output.closeHandler = () {
+ // Now read the contents of the file just written.
+ List<int> buffer2 = new List<int>(42);
+ file = new File(outFilename);
+ input = file.openInputStream();
+ input.dataHandler = () {
+ bytesRead = input.readInto(buffer2, 0, 42);
+ Expect.equals(42, bytesRead);
+ // Now compare the two buffers to check if they are identical.
+ for (int i = 0; i < buffer1.length; i++) {
+ Expect.equals(buffer1[i], buffer2[i]);
+ }
+ };
input.closeHandler = () {
// Delete the output file.
file.deleteSync();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698