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

Unified Diff: tests/compiler/dart2js/jsinterop/world_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/jsinterop/abstract_test.dart ('k') | tests/compiler/dart2js/kernel/helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/jsinterop/world_test.dart
diff --git a/tests/compiler/dart2js/jsinterop/world_test.dart b/tests/compiler/dart2js/jsinterop/world_test.dart
index f196b8e8520f9a0fb573a56f0448f5b0948b0aef..185e092586eadf32e55e8f2b1552c3b718bc8460 100644
--- a/tests/compiler/dart2js/jsinterop/world_test.dart
+++ b/tests/compiler/dart2js/jsinterop/world_test.dart
@@ -7,8 +7,7 @@ library jsinterop.world_test;
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
import 'package:compiler/src/common.dart';
-import 'package:compiler/src/elements/elements.dart'
- show Element, ClassElement;
+import 'package:compiler/src/elements/elements.dart' show Element, ClassElement;
import 'package:compiler/src/js_backend/js_backend.dart';
import 'package:compiler/src/world.dart';
import '../type_test_helper.dart';
@@ -22,8 +21,9 @@ void main() {
testClasses() async {
test(String mainSource,
{List<String> directlyInstantiated: const <String>[],
- List<String> indirectlyInstantiated: const <String>[]}) async {
- TypeEnvironment env = await TypeEnvironment.create(r"""
+ List<String> indirectlyInstantiated: const <String>[]}) async {
+ TypeEnvironment env = await TypeEnvironment.create(
+ r"""
@JS()
class A {
get foo;
@@ -72,11 +72,13 @@ newC() => new C(foo: 2);
newD() => new D(foo: 3);
newE() => new E(4);
newF() => new F(5);
-""", mainSource: """
+""",
+ mainSource: """
import 'package:js/js.dart';
$mainSource
-""", useMockCompiler: false);
+""",
+ useMockCompiler: false);
Map<String, ClassElement> classEnvironment = <String, ClassElement>{};
ClassElement registerClass(ClassElement cls) {
@@ -113,20 +115,23 @@ $mainSource
bool isInstantiated = false;
if (directlyInstantiated.contains(name)) {
isInstantiated = true;
- Expect.isTrue(world.isDirectlyInstantiated(cls),
+ Expect.isTrue(
+ world.isDirectlyInstantiated(cls),
"Expected $name to be directly instantiated in `${mainSource}`:"
- "\n${world.dump(cls)}");
+ "\n${world.dump(cls)}");
}
if (indirectlyInstantiated.contains(name)) {
isInstantiated = true;
- Expect.isTrue(world.isIndirectlyInstantiated(cls),
+ Expect.isTrue(
+ world.isIndirectlyInstantiated(cls),
"Expected $name to be indirectly instantiated in `${mainSource}`:"
- "\n${world.dump(cls)}");
+ "\n${world.dump(cls)}");
}
if (!isInstantiated && (name != 'Object' && name != 'Interceptor')) {
- Expect.isFalse(world.isInstantiated(cls),
+ Expect.isFalse(
+ world.isInstantiated(cls),
"Expected $name to be uninstantiated in `${mainSource}`:"
- "\n${world.dump(cls)}");
+ "\n${world.dump(cls)}");
}
}
}
@@ -149,11 +154,9 @@ $mainSource
directlyInstantiated: ['A', 'B', 'C', 'D'],
indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
- await test('main() => newE();',
- directlyInstantiated: ['E']);
+ await test('main() => newE();', directlyInstantiated: ['E']);
- await test('main() => newF();',
- directlyInstantiated: ['F']);
+ await test('main() => newF();', directlyInstantiated: ['F']);
await test('main() => [newD(), newE()];',
directlyInstantiated: ['A', 'B', 'C', 'D', 'E'],
« no previous file with comments | « tests/compiler/dart2js/jsinterop/abstract_test.dart ('k') | tests/compiler/dart2js/kernel/helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698