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

Side by Side Diff: tools/testing/dart/test_suite.dart

Issue 9448001: fix #resource tag in browser tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 8 years, 9 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
« no previous file with comments | « tests/language/src/ResourceTest.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) 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 /** 5 /**
6 * Classes and methods for enumerating and preparing tests. 6 * Classes and methods for enumerating and preparing tests.
7 * 7 *
8 * This library includes: 8 * This library includes:
9 * 9 *
10 * - Creating tests by listing all the Dart files in certain directories, 10 * - Creating tests by listing all the Dart files in certain directories,
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 void enqueueBrowserTest(String filename, 421 void enqueueBrowserTest(String filename,
422 String testName, 422 String testName,
423 Map optionsFromFile, 423 Map optionsFromFile,
424 Set<String> expectations, 424 Set<String> expectations,
425 bool isNegative) { 425 bool isNegative) {
426 if (optionsFromFile['isMultitest']) return; 426 if (optionsFromFile['isMultitest']) return;
427 bool isWebTest = optionsFromFile['containsDomImport']; 427 bool isWebTest = optionsFromFile['containsDomImport'];
428 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition']; 428 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition'];
429 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) { 429 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) {
430 print('Warning for $filename: Browser tests require #library ' + 430 print('Warning for $filename: Browser tests require #library ' +
431 'in any file that uses #import or #source'); 431 'in any file that uses #import, #source, or #resource');
432 } 432 }
433 433
434 final String component = configuration['component']; 434 final String component = configuration['component'];
435 final String testPath = 435 final String testPath =
436 new File(filename).fullPathSync().replaceAll('\\', '/'); 436 new File(filename).fullPathSync().replaceAll('\\', '/');
437 437
438 for (var vmOptions in optionsFromFile['vmOptions']) { 438 for (var vmOptions in optionsFromFile['vmOptions']) {
439 // Create a unique temporary directory for each set of vmOptions. 439 // Create a unique temporary directory for each set of vmOptions.
440 // TODO(dart:429): Replace separate replaceAlls with a RegExp when 440 // TODO(dart:429): Replace separate replaceAlls with a RegExp when
441 // replaceAll(RegExp, String) is implemented. 441 // replaceAll(RegExp, String) is implemented.
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 RegExp compileTimeRegExp = const RegExp(@"/// ([0-9][0-9]:){0,1}\s*compile-t ime error"); 769 RegExp compileTimeRegExp = const RegExp(@"/// ([0-9][0-9]:){0,1}\s*compile-t ime error");
770 RegExp staticCleanRegExp = const RegExp(@"// @static-clean"); 770 RegExp staticCleanRegExp = const RegExp(@"// @static-clean");
771 RegExp leadingHashRegExp = const RegExp(@"^#", multiLine: true); 771 RegExp leadingHashRegExp = const RegExp(@"^#", multiLine: true);
772 RegExp isolateStubsRegExp = const RegExp(@"// IsolateStubs=(.*)"); 772 RegExp isolateStubsRegExp = const RegExp(@"// IsolateStubs=(.*)");
773 RegExp domImportRegExp = 773 RegExp domImportRegExp =
774 const RegExp(@"^#import.*(dart:(dom|html)|html\.dart).*\)", 774 const RegExp(@"^#import.*(dart:(dom|html)|html\.dart).*\)",
775 multiLine: true); 775 multiLine: true);
776 RegExp libraryDefinitionRegExp = 776 RegExp libraryDefinitionRegExp =
777 const RegExp(@"^#library\(", multiLine: true); 777 const RegExp(@"^#library\(", multiLine: true);
778 RegExp sourceOrImportRegExp = 778 RegExp sourceOrImportRegExp =
779 const RegExp(@"^#(source|import)\(", multiLine: true); 779 const RegExp(@"^#(source|import|resource)\(", multiLine: true);
780 780
781 // Read the entire file into a byte buffer and transform it to a 781 // Read the entire file into a byte buffer and transform it to a
782 // String. This will treat the file as ascii but the only parts 782 // String. This will treat the file as ascii but the only parts
783 // we are interested in will be ascii in any case. 783 // we are interested in will be ascii in any case.
784 RandomAccessFile file = new File(filename).openSync(); 784 RandomAccessFile file = new File(filename).openSync();
785 List chars = new List(file.lengthSync()); 785 List chars = new List(file.lengthSync());
786 var offset = 0; 786 var offset = 0;
787 while (offset != chars.length) { 787 while (offset != chars.length) {
788 offset += file.readListSync(chars, offset, chars.length - offset); 788 offset += file.readListSync(chars, offset, chars.length - offset);
789 } 789 }
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 * $noCrash tests are expected to be flaky but not crash 1216 * $noCrash tests are expected to be flaky but not crash
1217 * $pass tests are expected to pass 1217 * $pass tests are expected to pass
1218 * $failOk tests are expected to fail that we won't fix 1218 * $failOk tests are expected to fail that we won't fix
1219 * $fail tests are expected to fail that we should fix 1219 * $fail tests are expected to fail that we should fix
1220 * $crash tests are expected to crash that we should fix 1220 * $crash tests are expected to crash that we should fix
1221 * $timeout tests are allowed to timeout 1221 * $timeout tests are allowed to timeout
1222 """; 1222 """;
1223 print(report); 1223 print(report);
1224 } 1224 }
1225 } 1225 }
OLDNEW
« no previous file with comments | « tests/language/src/ResourceTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698