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

Side by Side Diff: tests/standalone/io/test_extension_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Dart test program for testing native extensions. 5 // Dart test program for testing native extensions.
6 6
7 import "dart:io"; 7 import 'dart:async';
8 import 'dart:io';
9 import 'dart:isolate';
8 10
9 Future copyFileToDirectory(Path file, Path directory) { 11 Future copyFileToDirectory(Path file, Path directory) {
10 String src = file.toNativePath(); 12 String src = file.toNativePath();
11 String dst = directory.toNativePath(); 13 String dst = directory.toNativePath();
12 switch (Platform.operatingSystem) { 14 switch (Platform.operatingSystem) {
13 case 'linux': 15 case 'linux':
14 case 'macos': 16 case 'macos':
15 return Process.run('cp', [src, dst]); 17 return Process.run('cp', [src, dst]);
16 case 'windows': 18 case 'windows':
17 return Process.run('cmd.exe', ['/C', 'copy $src $dst']); 19 return Process.run('cmd.exe', ['/C', 'copy $src $dst']);
(...skipping 19 matching lines...) Expand all
37 Options options = new Options(); 39 Options options = new Options();
38 40
39 Path scriptDirectory = new Path.fromNative(options.script).directoryPath; 41 Path scriptDirectory = new Path.fromNative(options.script).directoryPath;
40 Path buildDirectory = new Path.fromNative(options.executable).directoryPath; 42 Path buildDirectory = new Path.fromNative(options.executable).directoryPath;
41 Directory tempDirectory = new Directory('').createTempSync(); 43 Directory tempDirectory = new Directory('').createTempSync();
42 Path testDirectory = new Path.fromNative(tempDirectory.path); 44 Path testDirectory = new Path.fromNative(tempDirectory.path);
43 45
44 // Copy test_extension shared library, test_extension.dart and 46 // Copy test_extension shared library, test_extension.dart and
45 // test_extension_tester.dart to the temporary test directory. 47 // test_extension_tester.dart to the temporary test directory.
46 copyFileToDirectory(getExtensionPath(buildDirectory), 48 copyFileToDirectory(getExtensionPath(buildDirectory),
47 testDirectory).chain((_) { 49 testDirectory).then((_) {
48 Path extensionDartFile = scriptDirectory.append('test_extension.dart'); 50 Path extensionDartFile = scriptDirectory.append('test_extension.dart');
49 return copyFileToDirectory(extensionDartFile, testDirectory); 51 return copyFileToDirectory(extensionDartFile, testDirectory);
50 }).chain((_) { 52 }).then((_) {
51 Path testExtensionTesterFile = 53 Path testExtensionTesterFile =
52 scriptDirectory.append('test_extension_tester.dart'); 54 scriptDirectory.append('test_extension_tester.dart');
53 return copyFileToDirectory(testExtensionTesterFile, testDirectory); 55 return copyFileToDirectory(testExtensionTesterFile, testDirectory);
54 }).chain((_) { 56 }).then((_) {
55 Path script = testDirectory.append('test_extension_tester.dart'); 57 Path script = testDirectory.append('test_extension_tester.dart');
56 return Process.run(options.executable, [script.toNativePath()]); 58 return Process.run(options.executable, [script.toNativePath()]);
57 })..then((ProcessResult result) { 59 })..then((ProcessResult result) {
58 Expect.equals(0, result.exitCode); 60 Expect.equals(0, result.exitCode);
59 tempDirectory.deleteSync(recursive: true); 61 tempDirectory.deleteSync(recursive: true);
60 })..handleException((_) { 62 })..catchError((_) {
61 tempDirectory.deleteSync(recursive: true); 63 tempDirectory.deleteSync(recursive: true);
62 }); 64 });
63 } 65 }
OLDNEW
« no previous file with comments | « tests/standalone/io/test_extension_fail_tester.dart ('k') | tests/standalone/io/test_runner_exit_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698