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

Side by Side Diff: pkg/analyzer/test/generated/java_io_test.dart

Issue 1287513002: Disable flaky test under Windows (and fix formatting from an easlier CL) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « pkg/analyzer/test/file_system/physical_resource_provider_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.java_io_test; 8 library engine.java_io_test;
9 9
10 import 'dart:io'; 10 import 'dart:io';
11 11
12 import 'package:analyzer/src/generated/java_io.dart'; 12 import 'package:analyzer/src/generated/java_io.dart';
13 import 'package:unittest/unittest.dart'; 13 import 'package:unittest/unittest.dart';
14 14
15 import '../utils.dart'; 15 import '../utils.dart';
16 16
17 main() { 17 main() {
18 initializeTestEnvironment(); 18 initializeTestEnvironment();
19 group('JavaFile', () { 19 group('JavaFile', () {
20 group('toURI', () { 20 group('toURI', () {
21 test('forAbsolute', () { 21 test('forAbsolute', () {
22 var tempDir = Directory.systemTemp.createTempSync('java_io_test'); 22 var tempDir = Directory.systemTemp.createTempSync('java_io_test');
23 try { 23 try {
24 String tempPath = JavaFile.pathContext 24 String tempPath = JavaFile.pathContext
25 .normalize(JavaFile.pathContext.absolute(tempDir.path)); 25 .normalize(JavaFile.pathContext.absolute(tempDir.path));
26 String path = JavaFile.pathContext.join(tempPath, 'foo.dart'); 26 String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
27 // we use an absolute path 27 // we use an absolute path
28 expect(JavaFile.pathContext.isAbsolute(path), isTrue, reason: '"$path" is not absolute'); 28 expect(JavaFile.pathContext.isAbsolute(path), isTrue,
29 reason: '"$path" is not absolute');
29 // test that toURI() returns an absolute URI 30 // test that toURI() returns an absolute URI
30 Uri uri = new JavaFile(path).toURI(); 31 Uri uri = new JavaFile(path).toURI();
31 expect(uri.isAbsolute, isTrue); 32 expect(uri.isAbsolute, isTrue);
32 expect(uri.scheme, 'file'); 33 expect(uri.scheme, 'file');
33 } finally { 34 } finally {
34 tempDir.deleteSync(recursive: true); 35 tempDir.deleteSync(recursive: true);
35 } 36 }
36 }); 37 });
37 test('forRelative', () { 38 test('forRelative', () {
38 var tempDir = Directory.systemTemp.createTempSync('java_io_test'); 39 var tempDir = Directory.systemTemp.createTempSync('java_io_test');
39 try { 40 try {
40 String tempPath = JavaFile.pathContext 41 String tempPath = JavaFile.pathContext
41 .normalize(JavaFile.pathContext.absolute(tempDir.path)); 42 .normalize(JavaFile.pathContext.absolute(tempDir.path));
42 String path = JavaFile.pathContext.join(tempPath, 'foo.dart'); 43 String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
43 expect(JavaFile.pathContext.isAbsolute(path), isTrue, reason: '"$path" is not absolute'); 44 expect(JavaFile.pathContext.isAbsolute(path), isTrue,
45 reason: '"$path" is not absolute');
44 // prepare a relative path 46 // prepare a relative path
45 // We should not check that "relPath" is actually relative - 47 // We should not check that "relPath" is actually relative -
46 // it may be not on Windows, if "temp" is on other disk. 48 // it may be not on Windows, if "temp" is on other disk.
47 String relPath = JavaFile.pathContext.relative(path); 49 String relPath = JavaFile.pathContext.relative(path);
48 // test that toURI() returns an absolute URI 50 // test that toURI() returns an absolute URI
49 Uri uri = new JavaFile(relPath).toURI(); 51 Uri uri = new JavaFile(relPath).toURI();
50 expect(uri.isAbsolute, isTrue); 52 expect(uri.isAbsolute, isTrue);
51 expect(uri.scheme, 'file'); 53 expect(uri.scheme, 'file');
52 } finally { 54 } finally {
53 tempDir.deleteSync(recursive: true); 55 tempDir.deleteSync(recursive: true);
54 } 56 }
55 }); 57 });
56 }); 58 });
57 }); 59 });
58 } 60 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/file_system/physical_resource_provider_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698