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

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

Issue 9960050: Add runtime=dartium webdriver support to test.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for batching Created 8 years, 8 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 /** 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 269
270 bool listRecursively() => false; 270 bool listRecursively() => false;
271 271
272 String shellPath() => TestUtils.dartShellFileName(configuration); 272 String shellPath() => TestUtils.dartShellFileName(configuration);
273 273
274 List<String> additionalOptions(String filename) => []; 274 List<String> additionalOptions(String filename) => [];
275 275
276 void forEachTest(Function onTest, Map testCache, String globalTempDir(), 276 void forEachTest(Function onTest, Map testCache, String globalTempDir(),
277 [Function onDone = null]) { 277 [Function onDone = null]) {
278 // If DumpRenderTree is required, and not yet updated, wait for update. 278 // If DumpRenderTree/Dartium is required, and not yet updated,
279 if (configuration['runtime'] == 'drt' && !DumpRenderTreeUpdater.updated) { 279 // wait for update.
280 Expect.isTrue(DumpRenderTreeUpdater.isActive); 280 var updater = runtimeUpdater(configuration['runtime']);
281 DumpRenderTreeUpdater.onUpdated.add(() { 281 if (updater !== null && !updater.updated) {
282 Expect.isTrue(updater.isActive);
283 updater.onUpdated.add(() {
282 forEachTest(onTest, testCache, globalTempDir, onDone); 284 forEachTest(onTest, testCache, globalTempDir, onDone);
283 }); 285 });
284 return; 286 return;
285 } 287 }
286 288
287 doTest = onTest; 289 doTest = onTest;
288 doDone = (onDone != null) ? onDone : (() => null); 290 doDone = (onDone != null) ? onDone : (() => null);
289 globalTemporaryDirectory = globalTempDir; 291 globalTemporaryDirectory = globalTempDir;
290 292
291 var filesRead = 0; 293 var filesRead = 0;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // TODO(efortuna): this shortening of htmlFilename is a band-aid until 553 // TODO(efortuna): this shortening of htmlFilename is a band-aid until
552 // the above TODO gets fixed. Windows cannot have paths that are longer 554 // the above TODO gets fixed. Windows cannot have paths that are longer
553 // than 260 characters, and without this hack, we were running past the 555 // than 260 characters, and without this hack, we were running past the
554 // the limit. 556 // the limit.
555 String htmlFilename = getHtmlName(filename); 557 String htmlFilename = getHtmlName(filename);
556 while ('${tempDir.path}/../$htmlFilename'.length >= 260) { 558 while ('${tempDir.path}/../$htmlFilename'.length >= 260) {
557 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); 559 htmlFilename = htmlFilename.substring(htmlFilename.length~/2);
558 } 560 }
559 htmlPath = '${tempDir.path}/../$htmlFilename'; 561 htmlPath = '${tempDir.path}/../$htmlFilename';
560 } 562 }
561 final String scriptPath = (compiler == 'none' && runtime == 'drt') ? 563 final String scriptPath = (compiler == 'none') ?
562 dartWrapperFilename : compiledDartWrapperFilename; 564 dartWrapperFilename : compiledDartWrapperFilename;
563 // Create the HTML file for the test. 565 // Create the HTML file for the test.
564 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); 566 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE);
565 String filePrefix = ''; 567 String filePrefix = '';
566 if (new Platform().operatingSystem() == 'windows') { 568 if (new Platform().operatingSystem() == 'windows') {
567 // Firefox on Windows does not like absolute file path names that start 569 // Firefox on Windows does not like absolute file path names that start
568 // with 'C:' adding 'file:///' solves the problem. 570 // with 'C:' adding 'file:///' solves the problem.
569 filePrefix = 'file:///'; 571 filePrefix = 'file:///';
570 } 572 }
571 htmlTest.writeStringSync(GetHtmlContents( 573 htmlTest.writeStringSync(GetHtmlContents(
(...skipping 30 matching lines...) Expand all
602 String compiledName = '${name.substring(0, end)}.js'; 604 String compiledName = '${name.substring(0, end)}.js';
603 commands.add(_compileCommand( 605 commands.add(_compileCommand(
604 '$dir/$name', '${tempDir.path}/$compiledName', 606 '$dir/$name', '${tempDir.path}/$compiledName',
605 compiler, tempDir.path, vmOptions)); 607 compiler, tempDir.path, vmOptions));
606 } 608 }
607 } 609 }
608 610
609 // Construct the command that executes the browser test 611 // Construct the command that executes the browser test
610 List<String> args; 612 List<String> args;
611 if (runtime == 'ie' || runtime == 'ff' || runtime == 'chrome' || 613 if (runtime == 'ie' || runtime == 'ff' || runtime == 'chrome' ||
612 runtime == 'safari' || runtime == 'opera') { 614 runtime == 'safari' || runtime == 'opera' || runtime == 'dartium') {
613 args = ['$dartDir/tools/testing/run_selenium.py', 615 args = ['$dartDir/tools/testing/run_selenium.py',
614 '--browser=$runtime', 616 '--browser=$runtime',
615 '--timeout=${configuration["timeout"] - 2}', 617 '--timeout=${configuration["timeout"] - 2}',
616 '--out=$htmlPath']; 618 '--out=$htmlPath'];
617 } else { 619 } else {
618 args = [ 620 args = [
619 '$dartDir/tools/testing/drt-trampoline.py', 621 '$dartDir/tools/testing/drt-trampoline.py',
620 dumpRenderTreeFilename, 622 dumpRenderTreeFilename,
621 '--no-timeout' 623 '--no-timeout'
622 ]; 624 ];
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 } 1307 }
1306 if (configuration['runtime'] != 'drt') { 1308 if (configuration['runtime'] != 'drt') {
1307 args.add("--allow-mock-compilation"); 1309 args.add("--allow-mock-compilation");
1308 } 1310 }
1309 } 1311 }
1310 return args; 1312 return args;
1311 } 1313 }
1312 1314
1313 static bool isBrowserRuntime(String runtime) => 1315 static bool isBrowserRuntime(String runtime) =>
1314 const <String>['drt', 1316 const <String>['drt',
1317 'dartium',
1315 'ie', 1318 'ie',
1316 'safari', 1319 'safari',
1317 'opera', 1320 'opera',
1318 'chrome', 1321 'chrome',
1319 'ff'].some((x) => x == runtime); 1322 'ff'].some((x) => x == runtime);
1320 } 1323 }
1321 1324
1322 class SummaryReport { 1325 class SummaryReport {
1323 static int total = 0; 1326 static int total = 0;
1324 static int skipped = 0; 1327 static int skipped = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 * $noCrash tests are expected to be flaky but not crash 1366 * $noCrash tests are expected to be flaky but not crash
1364 * $pass tests are expected to pass 1367 * $pass tests are expected to pass
1365 * $failOk tests are expected to fail that we won't fix 1368 * $failOk tests are expected to fail that we won't fix
1366 * $fail tests are expected to fail that we should fix 1369 * $fail tests are expected to fail that we should fix
1367 * $crash tests are expected to crash that we should fix 1370 * $crash tests are expected to crash that we should fix
1368 * $timeout tests are allowed to timeout 1371 * $timeout tests are allowed to timeout
1369 """; 1372 """;
1370 print(report); 1373 print(report);
1371 } 1374 }
1372 } 1375 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698