| Index: tools/testing/dart/test_runner.dart
|
| diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
|
| index e84b051b62a455c3b14002dde42cf35d920d1e3c..8e1363af458b18cbacf6c02dc3e0b04bd0c7093b 100644
|
| --- a/tools/testing/dart/test_runner.dart
|
| +++ b/tools/testing/dart/test_runner.dart
|
| @@ -157,8 +157,6 @@ class Command {
|
| String toString() => commandLine;
|
|
|
| Future<bool> get outputIsUpToDate => new Future.value(false);
|
| - Path get expectedOutputFile => null;
|
| - bool get isPixelTest => false;
|
| }
|
|
|
| class CompilationCommand extends Command {
|
| @@ -245,19 +243,10 @@ class CompilationCommand extends Command {
|
| }
|
|
|
| class ContentShellCommand extends Command {
|
| - /**
|
| - * 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.
|
| - */
|
| - Path expectedOutputPath;
|
| -
|
| ContentShellCommand._(String executable,
|
| String htmlFile,
|
| List<String> options,
|
| List<String> dartFlags,
|
| - Path this.expectedOutputPath,
|
| String configurationDir)
|
| : super._("content_shell",
|
| executable,
|
| @@ -284,20 +273,8 @@ class ContentShellCommand extends Command {
|
| return arguments;
|
| }
|
|
|
| - Path get expectedOutputFile => expectedOutputPath;
|
| - bool get isPixelTest => (expectedOutputFile != null &&
|
| - expectedOutputFile.filename.endsWith(".png"));
|
| -
|
| - void _buildHashCode(HashCodeBuilder builder) {
|
| - super._buildHashCode(builder);
|
| - builder.add(expectedOutputPath.toString());
|
| - }
|
| -
|
| bool _equal(Command other) {
|
| - return
|
| - other is ContentShellCommand &&
|
| - super._equal(other) &&
|
| - expectedOutputPath.toString() == other.expectedOutputPath.toString();
|
| + return other is ContentShellCommand && super._equal(other);
|
| }
|
|
|
| int get maxNumRetries => 3;
|
| @@ -411,11 +388,9 @@ class CommandBuilder {
|
| String htmlFile,
|
| List<String> options,
|
| List<String> dartFlags,
|
| - Path expectedOutputPath,
|
| String configurationDir) {
|
| ContentShellCommand command = new ContentShellCommand._(
|
| - executable, htmlFile, options, dartFlags, expectedOutputPath,
|
| - configurationDir);
|
| + executable, htmlFile, options, dartFlags, configurationDir);
|
| return _getUniqueCommand(command);
|
| }
|
|
|
| @@ -826,12 +801,6 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
| return Expectation.FAIL;
|
| }
|
|
|
| - if (command.expectedOutputFile != null) {
|
| - // We are either doing a pixel test or a layout test with content shell
|
| - if (_failedBecauseOfUnexpectedDRTOutput) {
|
| - return Expectation.FAIL;
|
| - }
|
| - }
|
| if (_browserTestFailure) {
|
| return Expectation.RUNTIME_ERROR;
|
| }
|
| @@ -859,58 +828,6 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
| bool get _rendererCrashed =>
|
| decodeUtf8(super.stdout).contains("#CRASHED - rendere");
|
|
|
| - bool get _failedBecauseOfUnexpectedDRTOutput {
|
| - /*
|
| - * 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
|
| - * ......
|
| - * ......
|
| - * Content-Length: ...\n
|
| - * <*png data>
|
| - * #EOF\n
|
| - * So we need to get the byte-range of the png data first, before
|
| - * comparing it with the content of the expected output file.
|
| - *
|
| - * On a layout tests, the DRT output is directly compared with the
|
| - * content of the expected output.
|
| - */
|
| - var file = new io.File(command.expectedOutputFile.toNativePath());
|
| - if (file.existsSync()) {
|
| - var bytesContentLength = "Content-Length:".codeUnits;
|
| - var bytesNewLine = "\n".codeUnits;
|
| - var bytesEOF = "#EOF\n".codeUnits;
|
| -
|
| - var expectedContent = file.readAsBytesSync();
|
| - if (command.isPixelTest) {
|
| - var startOfContentLength = findBytes(stdout, bytesContentLength);
|
| - if (startOfContentLength >= 0) {
|
| - var newLineAfterContentLength = findBytes(stdout,
|
| - bytesNewLine,
|
| - startOfContentLength);
|
| - if (newLineAfterContentLength > 0) {
|
| - var startPosition = newLineAfterContentLength +
|
| - bytesNewLine.length;
|
| - var endPosition = stdout.length - bytesEOF.length;
|
| -
|
| - return !areByteArraysEqual(expectedContent,
|
| - 0,
|
| - stdout,
|
| - startPosition,
|
| - endPosition - startPosition);
|
| - }
|
| - }
|
| - return true;
|
| - } else {
|
| - return !areByteArraysEqual(expectedContent, 0,
|
| - stdout, 0,
|
| - stdout.length);
|
| - }
|
| - }
|
| - return true;
|
| - }
|
| -
|
| bool get _browserTestFailure {
|
| // Browser tests fail unless stdout contains
|
| // 'Content-Type: text/plain' followed by 'PASS'.
|
|
|