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

Unified Diff: lib/testing/content_shell_test.dart

Issue 20863002: Introduce boot.js: this finally makes it possible to load and run Todomvc (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 5 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 | « lib/src/observable_transform.dart ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/testing/content_shell_test.dart
diff --git a/lib/testing/content_shell_test.dart b/lib/testing/content_shell_test.dart
index b05176ddd5a66a8bfba2925f74ce7ee5368d66fc..2f813192cac4e8a976e8335a9ac045ea8194854c 100644
--- a/lib/testing/content_shell_test.dart
+++ b/lib/testing/content_shell_test.dart
@@ -57,7 +57,8 @@ void _testHelper(_TestOptions options) {
for (var filePath in paths) {
var filename = path.basename(filePath);
test('compile $filename', () {
- var testArgs = ['-o', options.outDir, '--basedir', options.baseDir]
+ var testArgs = ['-o', options.outDir,
+ '--basedir', options.baseDir, '--no-css']
..addAll(options.compilerArgs)
..add(filePath);
expect(dwc.run(testArgs, printTime: false).then((res) {
@@ -75,29 +76,26 @@ void _testHelper(_TestOptions options) {
var finalOutDir = path.join(options.outDir, relativeToBase);
runTests(String search) {
- var outs;
-
- test('content_shell run $search', () {
- var args = ['--dump-render-tree'];
- args.addAll(filenames.map((name) => 'file://$finalOutDir/$name$search'));
- var env = {'DART_FLAGS': '--checked'};
- expect(Process.run('content_shell', args, environment: env).then((res) {
- expect(res.exitCode, 0, reason: 'content_shell exit code: '
- '${res.exitCode}. Contents of stderr: \n${res.stderr}');
- outs = res.stdout.split('#EOF\n')
- .where((s) => !s.trim().isEmpty).toList();
- expect(outs.length, filenames.length);
- }), completes);
- });
+ var output;
+
+ for (var filename in filenames) {
Siggi Cherem (dart-lang) 2013/07/30 23:32:04 I'm splitting each content_shell run to be separat
+ test('content_shell run $filename$search', () {
+ var args = ['--dump-render-tree',
+ 'file://$finalOutDir/$filename$search'];
+ var env = {'DART_FLAGS': '--checked'};
+ expect(Process.run('content_shell', args, environment: env).then((res) {
+ expect(res.exitCode, 0, reason: 'content_shell exit code: '
+ '${res.exitCode}. Contents of stderr: \n${res.stderr}');
+ var outs = res.stdout.split('#EOF\n')
+ .where((s) => !s.trim().isEmpty).toList();
+ expect(outs.length, 1);
+ output = outs.first;
+ }), completes);
+ });
- for (int i = 0; i < filenames.length; i++) {
- var filename = filenames[i];
- // TODO(sigmund): remove this extra variable dartbug.com/8698
- int j = i;
test('verify $filename $search', () {
- expect(outs, isNotNull, reason:
+ expect(output, isNotNull, reason:
'Output not available, maybe content_shell failed to run.');
- var output = outs[j];
var outPath = path.join(options.outDir, '$filename.txt');
new File(outPath).writeAsStringSync(output);
if (options.isRenderTest) {
@@ -178,8 +176,15 @@ class _TestOptions {
var args = _parseArgs(arguments, script);
if (args == null) return null;
var compilerArgs = args.rest;
- var filePattern = new RegExp(pattern != null ? pattern
- : (compilerArgs.length > 0 ? compilerArgs.removeAt(0) : '.'));
+ var filePattern;
+ if (pattern != null) {
+ filePattern = new RegExp(pattern);
+ } else if (compilerArgs.length > 0) {
+ filePattern = new RegExp(compilerArgs[0]);
+ compilerArgs = compilerArgs.sublist(1);
+ } else {
+ filePattern = new RegExp('.');
+ }
var scriptDir = path.absolute(path.dirname(script));
baseDir = path.join(scriptDir, baseDir);
« no previous file with comments | « lib/src/observable_transform.dart ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698