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

Unified Diff: lib/src/runner/runner_test.dart

Issue 1704773002: Load web tests using the plugin infrastructure. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 10 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
Index: lib/src/runner/runner_test.dart
diff --git a/lib/src/runner/runner_test.dart b/lib/src/runner/runner_test.dart
index ca2c54391f7da7373a0e2c078ad7adfb6c99bb4f..07645ce6eaae988dfbd963af1cc9afe9259c90df 100644
--- a/lib/src/runner/runner_test.dart
+++ b/lib/src/runner/runner_test.dart
@@ -16,6 +16,8 @@ import '../backend/test_platform.dart';
import '../utils.dart';
import '../util/remote_exception.dart';
+typedef StackTrace _MapTrace(StackTrace trace);
+
/// A test running remotely, controlled by a stream channel.
class RunnerTest extends Test {
final String name;
@@ -24,7 +26,10 @@ class RunnerTest extends Test {
/// The channel used to communicate with the test's [IframeListener].
final MultiChannel _channel;
- RunnerTest(this.name, this.metadata, this._channel);
+ /// The function used to reformat errors' stack traces.
+ final _MapTrace _mapTrace;
+
+ RunnerTest(this.name, this.metadata, this._channel, this._mapTrace);
LiveTest load(Suite suite, {Iterable<Group> groups}) {
var controller;
@@ -42,7 +47,7 @@ class RunnerTest extends Test {
if (message['type'] == 'error') {
var asyncError = RemoteException.deserialize(message['error']);
- var stackTrace = asyncError.stackTrace;
+ var stackTrace = _mapTrace(asyncError.stackTrace);
controller.addError(asyncError.error, stackTrace);
} else if (message['type'] == 'state-change') {
controller.setState(
@@ -83,6 +88,6 @@ class RunnerTest extends Test {
Test forPlatform(TestPlatform platform, {OperatingSystem os}) {
if (!metadata.testOn.evaluate(platform, os: os)) return null;
return new RunnerTest(
- name, metadata.forPlatform(platform, os: os), _channel);
+ name, metadata.forPlatform(platform, os: os), _channel, _mapTrace);
}
}

Powered by Google App Engine
This is Rietveld 408576698