mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:10:22 +00:00
Switch from DRT to content shell.
R=kustermann@google.com, ricow@google.com Review URL: https://codereview.chromium.org//15755017 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23328 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
21b88c4e2e
commit
4638137480
|
@ -40,8 +40,9 @@ main() {
|
|||
allowedHelp: {
|
||||
'vm': 'Run Dart code on the standalone dart vm.',
|
||||
'd8': 'Run JavaScript from the command line using v8.',
|
||||
// TODO(antonm): rename flag.
|
||||
'drt': 'Run Dart or JavaScript in the headless version of Chrome,\n'
|
||||
'DumpRenderTree.',
|
||||
'content shell.',
|
||||
'dartium': 'Run Dart or JavaScript in Dartium.',
|
||||
'ff': 'Run JavaScript in Firefox',
|
||||
'chrome': 'Run JavaScript in Chrome',
|
||||
|
@ -116,7 +117,8 @@ is 'dart file.dart' and you specify special command
|
|||
defaultsTo: false);
|
||||
|
||||
parser.addOption('dart', help: 'Path to dart executable');
|
||||
parser.addOption('drt', help: 'Path to DumpRenderTree executable');
|
||||
// TODO(antonm): rename the option.
|
||||
parser.addOption('drt', help: 'Path to content shell executable');
|
||||
parser.addOption('dartium', help: 'Path to Dartium Chrome executable');
|
||||
|
||||
parser.addFlag('batch', abbr: 'b',
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/**
|
||||
* Coverage controller logic - used by coverage test harness to embed tests in
|
||||
* DumpRenderTree and extract coverage information.
|
||||
* content shell and extract coverage information.
|
||||
*/
|
||||
|
||||
var LONG_LINE = 60000;
|
||||
|
@ -13,7 +13,7 @@ function onReceive(e) {
|
|||
if (e.data == 'unittest-suite-done') {
|
||||
var s = JSON.stringify(top._$jscoverage);
|
||||
var res = '';
|
||||
// DumpRenderTree has a bug on lines longer than 2^16, so we split them
|
||||
// conent shell has a bug on lines longer than 2^16, so we split them
|
||||
while (s.length > LONG_LINE) {
|
||||
res += s.substr(0, LONG_LINE) + '<br>\n';
|
||||
s = s.substr(LONG_LINE);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/**
|
||||
* Test controller logic - used by unit test harness to embed tests in
|
||||
* DumpRenderTree.
|
||||
* conent shell.
|
||||
*/
|
||||
|
||||
// Clear the console before every test run - this is Firebug specific code.
|
||||
|
@ -27,7 +27,7 @@ if (navigator.webkitStartDart) {
|
|||
navigator.webkitStartDart();
|
||||
}
|
||||
|
||||
// testRunner is provided by DRT or WebKit's layout tests.
|
||||
// testRunner is provided by content shell.
|
||||
// It is not available in selenium tests.
|
||||
var testRunner = window.testRunner || window.layoutTestController;
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ Function getFunctionForTypeNameOf() {
|
|||
if (!identical(JS('String', 'typeof(navigator)'), 'object')) return typeNameInChrome;
|
||||
|
||||
String userAgent = JS('String', "navigator.userAgent");
|
||||
// TODO(antonm): remove a reference to DumpRenderTree.
|
||||
if (contains(userAgent, 'Chrome') || contains(userAgent, 'DumpRenderTree')) {
|
||||
return typeNameInChrome;
|
||||
} else if (contains(userAgent, 'Firefox')) {
|
||||
|
|
|
@ -183,7 +183,8 @@ commands = {
|
|||
'test_docs': [test_docs, 'Tests docs.dart'],
|
||||
'test_chrome': [test_chrome, 'Run tests in checked mode in Chrome.\n'
|
||||
'\t\tOptionally provide name of test to run.'],
|
||||
'test_drt': [test_drt, 'Run tests in checked mode in DumpRenderTree.\n'
|
||||
# TODO(antonm): fix option name.
|
||||
'test_drt': [test_drt, 'Run tests in checked mode in content shell.\n'
|
||||
'\t\tOptionally provide name of test to run.'],
|
||||
'test_ff': [test_ff, 'Run tests in checked mode in Firefox.\n'
|
||||
'\t\tOptionally provide name of test to run.'],
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# for details. All rights reserved. Use of this source code is governed by a
|
||||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
# Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is
|
||||
# Gets or updates a content shell (a nearly headless build of chrome). This is
|
||||
# used for running browser tests of client applications.
|
||||
|
||||
import json
|
||||
|
@ -113,7 +113,7 @@ def EnsureConfig():
|
|||
if not HasBotoConfig():
|
||||
print >>sys.stderr, '''
|
||||
*******************************************************************************
|
||||
* WARNING: Can't download DumpRenderTree! This is required to test client apps.
|
||||
* WARNING: Can't download content shell! This is required to test client apps.
|
||||
* You need to do a one-time configuration step to access Google Storage.
|
||||
* Please run this command and follow the instructions:
|
||||
* %s config
|
||||
|
@ -347,7 +347,7 @@ def main():
|
|||
GetSdkRevision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN,
|
||||
SDK_PERMANENT, args.revision)
|
||||
elif positional[0] == 'drt':
|
||||
GetDartiumRevision('DumpRenderTree', DRT_DIR, DRT_VERSION,
|
||||
GetDartiumRevision('content_shell', DRT_DIR, DRT_VERSION,
|
||||
DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN,
|
||||
args.revision)
|
||||
CopyDrtFont(DRT_DIR)
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(antonm): rename to something like test_runner_updater.
|
||||
|
||||
library drt_updater;
|
||||
|
||||
import "dart:async";
|
||||
|
@ -60,18 +62,18 @@ class _DartiumUpdater {
|
|||
}
|
||||
}
|
||||
|
||||
_DartiumUpdater _dumpRenderTreeUpdater;
|
||||
_DartiumUpdater _contentShellUpdater;
|
||||
_DartiumUpdater _dartiumUpdater;
|
||||
|
||||
_DartiumUpdater runtimeUpdater(Map configuration) {
|
||||
String runtime = configuration['runtime'];
|
||||
if (runtime == 'drt' && configuration['drt'] == '') {
|
||||
// Download the default DumpRenderTree from Google Storage.
|
||||
if (_dumpRenderTreeUpdater == null) {
|
||||
_dumpRenderTreeUpdater = new _DartiumUpdater('DumpRenderTree',
|
||||
'get_archive.py', 'drt');
|
||||
// Download the default content shell from Google Storage.
|
||||
if (_contentShellUpdater == null) {
|
||||
_contentShellUpdater = new _DartiumUpdater('Content Shell',
|
||||
'get_archive.py', 'drt');
|
||||
}
|
||||
return _dumpRenderTreeUpdater;
|
||||
return _contentShellUpdater;
|
||||
} else if (runtime == 'dartium' && configuration['dartium'] == '') {
|
||||
// Download the default Dartium from Google Storage.
|
||||
if (_dartiumUpdater == null) {
|
||||
|
|
|
@ -85,6 +85,7 @@ is 'dart file.dart' and you specify special command
|
|||
['-c', '--compiler'],
|
||||
['none', 'dart2dart', 'dart2js', 'dartc', 'dartanalyzer'],
|
||||
'none'),
|
||||
// TODO(antonm): fix the option drt.
|
||||
new _TestOptionSpecification(
|
||||
'runtime',
|
||||
'''Where the tests should be run.
|
||||
|
@ -95,7 +96,7 @@ is 'dart file.dart' and you specify special command
|
|||
jsshell: Run JavaScript from the command line using firefox js-shell.
|
||||
|
||||
drt: Run Dart or JavaScript in the headless version of Chrome,
|
||||
DumpRenderTree.
|
||||
Content shell.
|
||||
|
||||
dartium: Run Dart or JavaScript in Dartium.
|
||||
|
||||
|
@ -252,8 +253,8 @@ is 'dart file.dart' and you specify special command
|
|||
[],
|
||||
''),
|
||||
new _TestOptionSpecification(
|
||||
'drt',
|
||||
'Path to DumpRenderTree executable',
|
||||
'drt', // TODO(antonm): fix the option name.
|
||||
'Path to content shell executable',
|
||||
['--drt'],
|
||||
[],
|
||||
''),
|
||||
|
|
|
@ -181,20 +181,20 @@ class CompilationCommand extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
class DumpRenderTreeCommand extends Command {
|
||||
class ContentShellCommand extends Command {
|
||||
/**
|
||||
* If [expectedOutputPath] is set, the output of DumpRenderTree is compared
|
||||
* If [expectedOutputPath] is set, the output of content shell is compared
|
||||
* with the content of [expectedOutputPath].
|
||||
* This is used for example for pixel tests, where [expectedOutputPath] points
|
||||
* to a *png file.
|
||||
*/
|
||||
io.Path expectedOutputPath;
|
||||
|
||||
DumpRenderTreeCommand(String executable,
|
||||
String htmlFile,
|
||||
List<String> options,
|
||||
List<String> dartFlags,
|
||||
io.Path this.expectedOutputPath)
|
||||
ContentShellCommand(String executable,
|
||||
String htmlFile,
|
||||
List<String> options,
|
||||
List<String> dartFlags,
|
||||
io.Path this.expectedOutputPath)
|
||||
: super(executable,
|
||||
_getArguments(options, htmlFile),
|
||||
_getEnvironment(dartFlags));
|
||||
|
@ -646,7 +646,7 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
|||
}
|
||||
|
||||
if (command.expectedOutputFile != null) {
|
||||
// We are either doing a pixel test or a layout test with DumpRenderTree
|
||||
// We are either doing a pixel test or a layout test with content shell
|
||||
return _failedBecauseOfUnexpectedDRTOutput;
|
||||
}
|
||||
return _browserTestFailure;
|
||||
|
@ -654,10 +654,10 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
|||
|
||||
bool get _failedBecauseOfMissingXDisplay {
|
||||
// Browser case:
|
||||
// If the browser test failed, it may have been because DumpRenderTree
|
||||
// and the virtual framebuffer X server didn't hook up, or DRT crashed with
|
||||
// a core dump. Sometimes DRT crashes after it has set the stdout to PASS,
|
||||
// so we have to do this check first.
|
||||
// If the browser test failed, it may have been because content shell
|
||||
// and the virtual framebuffer X server didn't hook up, or it crashed with
|
||||
// a core dump. Sometimes content shell crashes after it has set the stdout
|
||||
// to PASS, so we have to do this check first.
|
||||
var stderrLines = decodeUtf8(super.stderr).split("\n");
|
||||
for (String line in stderrLines) {
|
||||
// TODO(kustermann,ricow): Issue: 7564
|
||||
|
@ -678,7 +678,7 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
|||
|
||||
bool get _failedBecauseOfUnexpectedDRTOutput {
|
||||
/*
|
||||
* The output of DumpRenderTree is different for pixel tests than for
|
||||
* The output of content shell is different for pixel tests than for
|
||||
* layout tests.
|
||||
*
|
||||
* On a pixel test, the DRT output has the following format
|
||||
|
|
|
@ -517,7 +517,7 @@ class StandardTestSuite extends TestSuite {
|
|||
}
|
||||
|
||||
/**
|
||||
* If DumpRenderTree/Dartium is required, and not yet updated, waits for
|
||||
* If Content shell/Dartium is required, and not yet updated, waits for
|
||||
* the update then completes. Otherwise completes immediately.
|
||||
*/
|
||||
Future updateDartium() {
|
||||
|
@ -1018,9 +1018,10 @@ class StandardTestSuite extends TestSuite {
|
|||
}
|
||||
|
||||
var dartFlags = [];
|
||||
var dumpRenderTreeOptions = [];
|
||||
var contentShellOptions = [];
|
||||
|
||||
dumpRenderTreeOptions.add('--no-timeout');
|
||||
contentShellOptions.add('--no-timeout');
|
||||
contentShellOptions.add('--dump-render-tree');
|
||||
|
||||
if (compiler == 'none' || compiler == 'dart2dart') {
|
||||
dartFlags.add('--ignore-unrecognized-flags');
|
||||
|
@ -1034,15 +1035,15 @@ class StandardTestSuite extends TestSuite {
|
|||
if (expectedOutput != null) {
|
||||
if (expectedOutput.toNativePath().endsWith('.png')) {
|
||||
// pixel tests are specified by running DRT "foo.html'-p"
|
||||
dumpRenderTreeOptions.add('--notree');
|
||||
contentShellOptions.add('--notree');
|
||||
fullHtmlPath = "${fullHtmlPath}'-p";
|
||||
}
|
||||
}
|
||||
commandSet.add(new DumpRenderTreeCommand(dumpRenderTreeFilename,
|
||||
fullHtmlPath,
|
||||
dumpRenderTreeOptions,
|
||||
dartFlags,
|
||||
expectedOutput));
|
||||
commandSet.add(new ContentShellCommand(contentShellFilename,
|
||||
fullHtmlPath,
|
||||
contentShellOptions,
|
||||
dartFlags,
|
||||
expectedOutput));
|
||||
}
|
||||
|
||||
// Create BrowserTestCase and queue it.
|
||||
|
@ -1172,15 +1173,15 @@ class StandardTestSuite extends TestSuite {
|
|||
}
|
||||
}
|
||||
|
||||
String get dumpRenderTreeFilename {
|
||||
String get contentShellFilename {
|
||||
if (configuration['drt'] != '') {
|
||||
return configuration['drt'];
|
||||
}
|
||||
if (Platform.operatingSystem == 'macos') {
|
||||
return dartDir.append('/client/tests/drt/DumpRenderTree.app/Contents/'
|
||||
'MacOS/DumpRenderTree').toNativePath();
|
||||
return dartDir.append('/client/tests/drt/Content Shell.app/Contents/'
|
||||
'MacOS/Content Shell').toNativePath();
|
||||
}
|
||||
return dartDir.append('client/tests/drt/DumpRenderTree').toNativePath();
|
||||
return dartDir.append('client/tests/drt/content_shell').toNativePath();
|
||||
}
|
||||
|
||||
String get dartiumFilename {
|
||||
|
|
|
@ -116,11 +116,11 @@ function parseFile(type, onDone, entry, file, searchResultIndex) {
|
|||
|
||||
/*
|
||||
// TODO(jacobr): Make this run on platforms other than OS X.
|
||||
var cmd = '../../../client/tests/drt/DumpRenderTree.app/Contents/MacOS/' +
|
||||
'DumpRenderTree ' + absoluteDumpFileName;
|
||||
var cmd = '../../../client/tests/drt/Content Shell.app/Contents/MacOS/' +
|
||||
Content Shell' + absoluteDumpFileName;
|
||||
*/
|
||||
// TODO(eub): Make this run on platforms other than Linux.
|
||||
var cmd = '../../../client/tests/drt/DumpRenderTree ' + absoluteDumpFileName;
|
||||
var cmd = '../../../client/tests/drt/content_shell ' + absoluteDumpFileName;
|
||||
console.log(cmd);
|
||||
exec(cmd,
|
||||
function (error, stdout, stderr) {
|
||||
|
|
|
@ -16,10 +16,12 @@ ArgParser getOptionParser() {
|
|||
allowed: ['vm', 'drt-dart', 'drt-js'],
|
||||
allowedHelp: {
|
||||
'vm': 'Run Dart code natively on the standalone dart vm.',
|
||||
// TODO(antonm): fix option name.
|
||||
'drt-dart': 'Run Dart code natively in the headless version of\n'
|
||||
'Chrome, DumpRenderTree.',
|
||||
'Chrome, Content shell.',
|
||||
// TODO(antonm): fix option name.
|
||||
'drt-js': 'Run Dart compiled to JavaScript in the headless version\n'
|
||||
'of Chrome, DumpRenderTree.'
|
||||
'of Chrome, Content shell.'
|
||||
});
|
||||
|
||||
parser.addFlag('checked', defaultsTo: false,
|
||||
|
|
|
@ -41,16 +41,18 @@
|
|||
* The three runtimes are:
|
||||
*
|
||||
* vm - run native Dart in the VM; i.e. using $DARTSDK/dart-sdk/bin/dart.
|
||||
* drt-dart - run native Dart in DumpRenderTree, the headless version of
|
||||
* Dartium, which is located in $DARTSDK/chromium/DumpRenderTree, if
|
||||
* TODO(antonm): fix the option name.
|
||||
* drt-dart - run native Dart in content shell, the headless version of
|
||||
* Dartium, which is located in $DARTSDK/chromium/content_shell, if
|
||||
* you installed the SDK that is bundled with the editor, or available
|
||||
* from http://gsdview.appspot.com/dartium-archive/continuous/
|
||||
* otherwise.
|
||||
*
|
||||
* drt-js - run Dart compiled to Javascript in DumpRenderTree.
|
||||
* TODO(antonm): fix the option name.
|
||||
* drt-js - run Dart compiled to Javascript in content shell.
|
||||
*
|
||||
* testrunner supports simple DOM render tests. These can use expected values
|
||||
* for the render output from DumpRenderTree, either are textual DOM
|
||||
* for the render output from content shell, either are textual DOM
|
||||
* descriptions (`--layout-tests`) or pixel renderings (`--pixel-tests`).
|
||||
* When running layout tests, testrunner will see if there is a file with
|
||||
* a .png or a .txt extension in a directory with the same name as the
|
||||
|
@ -357,19 +359,19 @@ void sanitizeConfig(Map config, ArgParser parser) {
|
|||
config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart';
|
||||
config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub';
|
||||
config['drt'] =
|
||||
'$dartsdk/chromium/DumpRenderTree.app/Contents/MacOS/DumpRenderTree';
|
||||
'$dartsdk/chromium/Content Shell.app/Contents/MacOS/Content Shell';
|
||||
} else if (Platform.operatingSystem == 'linux') {
|
||||
config['dart2js'] =
|
||||
'$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js';
|
||||
config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart';
|
||||
config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub';
|
||||
config['drt'] = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree';
|
||||
config['drt'] = '$dartsdk${pathSep}chromium${pathSep}content_shell';
|
||||
} else {
|
||||
config['dart2js'] =
|
||||
'$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js.bat';
|
||||
config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart.exe';
|
||||
config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub.bat';
|
||||
config['drt'] = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree.exe';
|
||||
config['drt'] = '$dartsdk${pathSep}chromium${pathSep}content_shell.exe';
|
||||
}
|
||||
|
||||
for (var prog in [ 'drt', 'dart', 'pub', 'dart2js' ]) {
|
||||
|
|
Loading…
Reference in a new issue