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

Unified Diff: tools/testing/dart/test_runner.dart

Issue 26998002: Remove pixel/layout tests in tests/utils + special casing in the testing scripts for pixel/layout t… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'.
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698