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

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

Issue 11275217: Refactor test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make test case enqueuing future based. Created 8 years, 1 month 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 #library("test_options_parser"); 5 #library("test_options_parser");
6 6
7 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:math"); 8 #import("dart:math");
9 #import("drt_updater.dart"); 9 #import("drt_updater.dart");
10 #import("test_suite.dart"); 10 #import("test_suite.dart");
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 'opera']; 409 'opera'];
410 break; 410 break;
411 case 'dartc': 411 case 'dartc':
412 validRuntimes = const ['none']; 412 validRuntimes = const ['none'];
413 break; 413 break;
414 case 'none': 414 case 'none':
415 case 'dart2dart': 415 case 'dart2dart':
416 validRuntimes = const ['vm', 'drt', 'dartium']; 416 validRuntimes = const ['vm', 'drt', 'dartium'];
417 break; 417 break;
418 } 418 }
419 if (!Contains(config['runtime'], validRuntimes)) { 419 if (!validRuntimes.contains(config['runtime'])) {
420 isValid = false; 420 isValid = false;
421 print("Warning: combination of ${config['compiler']} and " 421 print("Warning: combination of ${config['compiler']} and "
422 "${config['runtime']} is invalid. Skipping this combination."); 422 "${config['runtime']} is invalid. Skipping this combination.");
423 } 423 }
424 if ((config['runtime'] == 'ie9' || config['runtime'] == 'ie10') && 424 if ((config['runtime'] == 'ie9' || config['runtime'] == 'ie10') &&
425 Platform.operatingSystem != 'windows') { 425 Platform.operatingSystem != 'windows') {
426 isValid = false; 426 isValid = false;
427 print("Warning cannot run Internet Explorer on non-Windows operating" 427 print("Warning cannot run Internet Explorer on non-Windows operating"
428 " system."); 428 " system.");
429 } 429 }
430 if (config['shard'] < 1 || config['shard'] > config['shards']) { 430 if (config['shard'] < 1 || config['shard'] > config['shards']) {
431 isValid = false; 431 isValid = false;
432 print("Error: shard index is ${config['shard']} out of " 432 print("Error: shard index is ${config['shard']} out of "
433 "${config['shards']} shards"); 433 "${config['shards']} shards");
434 } 434 }
435 if (config['runtime'] == 'dartium' && 435 if (config['runtime'] == 'dartium' &&
436 Contains(config['compiler'], const ['none', 'dart2dart']) && 436 const ['none', 'dart2dart'].contains(config['compiler']) &&
437 config['checked']) { 437 config['checked']) {
438 // TODO(vsm): Set the DART_FLAGS environment appropriately when 438 // TODO(vsm): Set the DART_FLAGS environment appropriately when
439 // invoking Selenium to support checked mode. It's not clear 439 // invoking Selenium to support checked mode. It's not clear
440 // the current selenium API supports this. 440 // the current selenium API supports this.
441 isValid = false; 441 isValid = false;
442 print("Warning: checked mode is not yet supported for dartium tests."); 442 print("Warning: checked mode is not yet supported for dartium tests.");
443 } 443 }
444 return isValid; 444 return isValid;
445 } 445 }
446 446
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 timeout = 60; 562 timeout = 60;
563 if (configuration['mode'] == 'debug') { 563 if (configuration['mode'] == 'debug') {
564 timeout *= 8; 564 timeout *= 8;
565 } 565 }
566 if (configuration['host_checked']) { 566 if (configuration['host_checked']) {
567 timeout *= 16; 567 timeout *= 16;
568 } 568 }
569 if (configuration['checked']) { 569 if (configuration['checked']) {
570 timeout *= 2; 570 timeout *= 2;
571 } 571 }
572 if (Contains(configuration['runtime'], 572
573 const ['ie9', 'ie10', 'ff', 'chrome', 'safari', 573 const BROWSERS = const [
574 'opera'])) { 574 'ie9', 'ie10', 'ff', 'chrome', 'safari', 'opera'
575 ];
576
577 if (BROWSERS.contains(configuration['runtime'])) {
575 timeout *= 8; // Allow additional time for browser testing to run. 578 timeout *= 8; // Allow additional time for browser testing to run.
576 } 579 }
577 break; 580 break;
578 default: 581 default:
579 if (configuration['mode'] == 'debug') { 582 if (configuration['mode'] == 'debug') {
580 timeout *= 2; 583 timeout *= 2;
581 } 584 }
582 if (Contains(configuration['runtime'], const ['drt', 'dartium'])) { 585 if (const ['drt', 'dartium'].contains(configuration['runtime'])) {
583 timeout *= 4; // Allow additional time for browser testing to run. 586 timeout *= 4; // Allow additional time for browser testing to run.
584 } 587 }
585 break; 588 break;
586 } 589 }
587 configuration['timeout'] = timeout; 590 configuration['timeout'] = timeout;
588 } 591 }
589 592
590 return [configuration]; 593 return [configuration];
591 } 594 }
592 595
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 return option; 661 return option;
659 } 662 }
660 } 663 }
661 print('Unknown test option $name'); 664 print('Unknown test option $name');
662 exit(1); 665 exit(1);
663 } 666 }
664 667
665 668
666 List<_TestOptionSpecification> _options; 669 List<_TestOptionSpecification> _options;
667 } 670 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698