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

Unified Diff: test/loader_file_test.dart

Issue 1612003002: Add browser-compatible version. (Closed) Base URL: https://github.com/dart-lang/resource.git@master
Patch Set: Made test run Created 4 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 | « test/loader_data_test.dart ('k') | test/loader_http_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/loader_file_test.dart
diff --git a/test/loader_file_test.dart b/test/loader_file_test.dart
index aa4c23882abf05e6b4930d4b83adff18383163e6..82648558e217bc6484a8a932b5b879497e68faa1 100644
--- a/test/loader_file_test.dart
+++ b/test/loader_file_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+@TestOn("vm");
+
import "dart:async";
import "dart:convert";
import "dart:io";
@@ -11,11 +13,11 @@ import "package:test/test.dart";
const content = "Rødgrød med fløde";
-
main() {
var dir;
+ int dirCounter = 0;
setUp(() {
- dir = Directory.systemTemp.createTempSync('testdir');
+ dir = Directory.systemTemp.createTempSync('testdir${dirCounter++}');
});
testFile(Encoding encoding) {
group("${encoding.name}", () {
@@ -25,10 +27,7 @@ main() {
var dirUri = dir.uri;
uri = dirUri.resolve("file.txt");
file = new File.fromUri(uri);
- file.createSync();
- var sink = file.openWrite(encoding: encoding);
- sink.write(content);
- sink.close();
+ file.writeAsBytesSync(encoding.encode(content));
});
test("read string", () async {
« no previous file with comments | « test/loader_data_test.dart ('k') | test/loader_http_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698