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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 11883033: Fixed utf8 encoding/decoding issues in the testing scripts (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « tools/testing/dart/test_runner.dart ('k') | tools/testing/dart/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index c458e527f7fa317ef05ee3f80ba58900c7ae31f1..114a34afef6cb11d7b1db4235cfb8d0a6d5adac4 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -17,11 +17,12 @@ library test_suite;
import "dart:async";
import "dart:io";
import "dart:isolate";
+import "dart:uri";
+import "drt_updater.dart";
+import "multitest.dart";
import "status_file_parser.dart";
import "test_runner.dart";
-import "multitest.dart";
-import "drt_updater.dart";
-import "dart:uri";
+import "utils.dart";
import '../../../pkg/path/lib/path.dart' as pathLib;
part "browser_test.dart";
@@ -1309,18 +1310,9 @@ class StandardTestSuite extends TestSuite {
RegExp sourceOrImportRegExp =
new RegExp("^(#source|#import|part)[ \t]+[\('\"]", multiLine: true);
- // Read the entire file into a byte buffer and transform it to a
- // String. This will treat the file as ascii but the only parts
- // we are interested in will be ascii in any case.
- RandomAccessFile file = new File.fromPath(filePath).openSync(FileMode.READ);
- List chars = new List(file.lengthSync());
- var offset = 0;
- while (offset != chars.length) {
- offset += file.readListSync(chars, offset, chars.length - offset);
- }
- file.closeSync();
- String contents = new String.fromCharCodes(chars);
- chars = null;
+ var bytes = new File.fromPath(filePath).readAsBytesSync();
+ String contents = decodeUtf8(bytes);
+ bytes = null;
// Find the options in the file.
List<List> result = new List<List>();
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | tools/testing/dart/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698