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

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

Issue 68113023: Use browser_controller instead of selenium in test scripts, by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « tools/testing/dart/test_options.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 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 // Construct the command that executes the browser test 1086 // Construct the command that executes the browser test
1087 do { 1087 do {
1088 List<Command> commandSet = new List<Command>.from(commands); 1088 List<Command> commandSet = new List<Command>.from(commands);
1089 1089
1090 var htmlPath_subtest = _createUrlPathFromFile(new Path(htmlPath)); 1090 var htmlPath_subtest = _createUrlPathFromFile(new Path(htmlPath));
1091 var fullHtmlPath = _getUriForBrowserTest(info, htmlPath_subtest, 1091 var fullHtmlPath = _getUriForBrowserTest(info, htmlPath_subtest,
1092 subtestNames, subtestIndex); 1092 subtestNames, subtestIndex);
1093 1093
1094 List<String> args = <String>[]; 1094 List<String> args = <String>[];
1095 1095
1096 if (configuration['use_browser_controller']) { 1096 if (runtime == "drt") {
1097 var dartFlags = [];
1098 var contentShellOptions = [];
1099
1100 contentShellOptions.add('--no-timeout');
1101 contentShellOptions.add('--dump-render-tree');
1102
1103 if (compiler == 'none' || compiler == 'dart2dart') {
1104 dartFlags.add('--ignore-unrecognized-flags');
1105 if (configuration["checked"]) {
1106 dartFlags.add('--enable_asserts');
1107 dartFlags.add("--enable_type_checks");
1108 }
1109 dartFlags.addAll(vmOptions);
1110 }
1111
1112 commandSet.add(CommandBuilder.instance.getContentShellCommand(
1113 contentShellFilename, fullHtmlPath, contentShellOptions,
1114 dartFlags, configurationDir));
1115 } else if (configuration['use_browser_controller']) {
1097 // This command is not actually run, it is used for reproducing 1116 // This command is not actually run, it is used for reproducing
1098 // the failure. 1117 // the failure.
1099 args = ['tools/testing/dart/launch_browser.dart', 1118 args = ['tools/testing/dart/launch_browser.dart',
1100 runtime, 1119 runtime,
1101 fullHtmlPath]; 1120 fullHtmlPath];
1102 commandSet.add(CommandBuilder.instance.getBrowserTestCommand( 1121 commandSet.add(CommandBuilder.instance.getBrowserTestCommand(
1103 runtime, fullHtmlPath, TestUtils.dartTestExecutable.toString(), 1122 runtime, fullHtmlPath, TestUtils.dartTestExecutable.toString(),
1104 args, configurationDir, checkedMode: configuration['checked'])); 1123 args, configurationDir, checkedMode: configuration['checked']));
1105 } else if (TestUtils.usesWebDriver(runtime)) { 1124 } else {
1125 assert(TestUtils.usesWebDriver(runtime));
1106 args = [ 1126 args = [
1107 dartDir.append('tools/testing/run_selenium.py').toNativePath(), 1127 dartDir.append('tools/testing/run_selenium.py').toNativePath(),
1108 '--browser=$runtime', 1128 '--browser=$runtime',
1109 // NOTE: This value will be overridden by the test runner 1129 // NOTE: This value will be overridden by the test runner
1110 '--timeout=${configuration['timeout']}', 1130 '--timeout=${configuration['timeout']}',
1111 '--out=$fullHtmlPath']; 1131 '--out=$fullHtmlPath'];
1112 if (runtime == 'dartium') { 1132 if (runtime == 'dartium') {
1113 var dartiumLocation = 1133 var dartiumLocation =
1114 Locations.getBrowserLocation('dartium', configuration); 1134 Locations.getBrowserLocation('dartium', configuration);
1115 args.add('--executable=$dartiumLocation'); 1135 args.add('--executable=$dartiumLocation');
1116 } 1136 }
1117 if (subtestIndex != 0) { 1137 if (subtestIndex != 0) {
1118 args.add('--force-refresh'); 1138 args.add('--force-refresh');
1119 } 1139 }
1120 commandSet.add(CommandBuilder.instance.getSeleniumTestCommand( 1140 commandSet.add(CommandBuilder.instance.getSeleniumTestCommand(
1121 runtime, fullHtmlPath, 'python', args, configurationDir)); 1141 runtime, fullHtmlPath, 'python', args, configurationDir));
1122 } else {
1123 assert(runtime == "drt");
1124
1125 var dartFlags = [];
1126 var contentShellOptions = [];
1127
1128 contentShellOptions.add('--no-timeout');
1129 contentShellOptions.add('--dump-render-tree');
1130
1131 if (compiler == 'none' || compiler == 'dart2dart') {
1132 dartFlags.add('--ignore-unrecognized-flags');
1133 if (configuration["checked"]) {
1134 dartFlags.add('--enable_asserts');
1135 dartFlags.add("--enable_type_checks");
1136 }
1137 dartFlags.addAll(vmOptions);
1138 }
1139
1140 commandSet.add(CommandBuilder.instance.getContentShellCommand(
1141 contentShellFilename, fullHtmlPath, contentShellOptions,
1142 dartFlags, configurationDir));
1143 } 1142 }
1144 1143
1145 // Create BrowserTestCase and queue it. 1144 // Create BrowserTestCase and queue it.
1146 String testDisplayName = '$suiteName/$testName'; 1145 String testDisplayName = '$suiteName/$testName';
1147 var testCase; 1146 var testCase;
1148 if (info.optionsFromFile['isMultiHtmlTest']) { 1147 if (info.optionsFromFile['isMultiHtmlTest']) {
1149 testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}'; 1148 testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}';
1150 testCase = new BrowserTestCase(testDisplayName, 1149 testCase = new BrowserTestCase(testDisplayName,
1151 commandSet, configuration, 1150 commandSet, configuration,
1152 expectations['$testName/${subtestNames[subtestIndex]}'], 1151 expectations['$testName/${subtestNames[subtestIndex]}'],
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 * $pass tests are expected to pass 2061 * $pass tests are expected to pass
2063 * $failOk tests are expected to fail that we won't fix 2062 * $failOk tests are expected to fail that we won't fix
2064 * $fail tests are expected to fail that we should fix 2063 * $fail tests are expected to fail that we should fix
2065 * $crash tests are expected to crash that we should fix 2064 * $crash tests are expected to crash that we should fix
2066 * $timeout tests are allowed to timeout 2065 * $timeout tests are allowed to timeout
2067 * $compileErrorSkip tests are skipped on browsers due to compile-time error 2066 * $compileErrorSkip tests are skipped on browsers due to compile-time error
2068 """; 2067 """;
2069 print(report); 2068 print(report);
2070 } 2069 }
2071 } 2070 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698