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

Unified Diff: tests/compiler/dart2js/user_crash_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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 | « tests/compiler/dart2js/use_strict_test.dart ('k') | tests/compiler/dart2js/value_range2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/user_crash_test.dart
diff --git a/tests/compiler/dart2js/user_crash_test.dart b/tests/compiler/dart2js/user_crash_test.dart
index 305de2ae424da49c8981b34ab926458f701b1a78..0af3e6747e49ea2cda2bfd1ff83e854490c6973d 100644
--- a/tests/compiler/dart2js/user_crash_test.dart
+++ b/tests/compiler/dart2js/user_crash_test.dart
@@ -13,34 +13,43 @@ final EXCEPTION = 'Crash';
main() {
asyncTest(() async {
test('Empty program', await run());
- test('Crash diagnostics',
- await run(diagnostics: new CrashingDiagnostics()),
- expectedLines: [
- 'Uncaught exception in diagnostic handler: $EXCEPTION',
- null /* Stack trace*/],
- expectedExceptions: [EXCEPTION]);
- test('Throw in package discovery',
- await run(packagesDiscoveryProvider: (_) { throw EXCEPTION; }),
- expectedLines: [
- 'Uncaught exception in package discovery: $EXCEPTION',
- null /* Stack trace*/],
- expectedExceptions: [EXCEPTION]);
- test('new Future.error in package discovery',
- await run(packagesDiscoveryProvider:
- (_) => new Future.error(EXCEPTION)),
- expectedExceptions: [EXCEPTION]);
+ test('Crash diagnostics', await run(diagnostics: new CrashingDiagnostics()),
+ expectedLines: [
+ 'Uncaught exception in diagnostic handler: $EXCEPTION',
+ null /* Stack trace*/
+ ],
+ expectedExceptions: [
+ EXCEPTION
+ ]);
+ test(
+ 'Throw in package discovery',
+ await run(packagesDiscoveryProvider: (_) {
+ throw EXCEPTION;
+ }),
+ expectedLines: [
+ 'Uncaught exception in package discovery: $EXCEPTION',
+ null /* Stack trace*/
+ ],
+ expectedExceptions: [
+ EXCEPTION
+ ]);
+ test(
+ 'new Future.error in package discovery',
+ await run(
+ packagesDiscoveryProvider: (_) => new Future.error(EXCEPTION)),
+ expectedExceptions: [EXCEPTION]);
test('Throw in input provider',
- await run(memorySourceFiles: new CrashingMap()),
- expectedLines: [
- 'Uncaught exception in input provider: $EXCEPTION',
- null, // Stack trace
- 'memory:main.dart:\nError: $EXCEPTION' /* READ_SELF_ERROR */]);
+ await run(memorySourceFiles: new CrashingMap()),
+ expectedLines: [
+ 'Uncaught exception in input provider: $EXCEPTION',
+ null, // Stack trace
+ 'memory:main.dart:\nError: $EXCEPTION' /* READ_SELF_ERROR */
+ ]);
});
}
void test(String title, RunResult result,
- {List expectedLines: const [],
- List expectedExceptions: const []}) {
+ {List expectedLines: const [], List expectedExceptions: const []}) {
print('--------------------------------------------------------------------');
print('Running $title');
print('--------------------------------------------------------------------');
@@ -61,8 +70,8 @@ void test(String title, RunResult result,
Future<RunResult> run(
{Map<String, String> memorySourceFiles: const {'main.dart': 'main() {}'},
- CompilerDiagnostics diagnostics,
- PackagesDiscoveryProvider packagesDiscoveryProvider}) async {
+ CompilerDiagnostics diagnostics,
+ PackagesDiscoveryProvider packagesDiscoveryProvider}) async {
RunResult result = new RunResult();
await runZoned(() async {
try {
@@ -74,10 +83,8 @@ Future<RunResult> run(
} catch (e) {
result.exceptions.add(e);
}
-
- },
- zoneSpecification: new ZoneSpecification(print:
- (Zone self, ZoneDelegate parent, Zone zone, String line) {
+ }, zoneSpecification: new ZoneSpecification(
+ print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
result.lines.add(line);
}));
return result;
@@ -99,4 +106,4 @@ class CrashingMap implements Map<String, String> {
operator [](_) => throw EXCEPTION;
noSuchMethod(_) => null;
-}
+}
« no previous file with comments | « tests/compiler/dart2js/use_strict_test.dart ('k') | tests/compiler/dart2js/value_range2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698