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

Unified Diff: tests/compiler/dart2js/expect_annotations_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
Index: tests/compiler/dart2js/expect_annotations_test.dart
diff --git a/tests/compiler/dart2js/expect_annotations_test.dart b/tests/compiler/dart2js/expect_annotations_test.dart
index 8e2abcdccfd376bf73fb427ffae9e42772e4b062..1d1a235c33496aad594b50d7851adfd8e8aded4d 100644
--- a/tests/compiler/dart2js/expect_annotations_test.dart
+++ b/tests/compiler/dart2js/expect_annotations_test.dart
@@ -61,69 +61,64 @@ main() {
'AssumeDynamicClass is unresolved.');
void testTypeMatch(FunctionElement function, TypeMask expectedParameterType,
- TypeMask expectedReturnType, TypesInferrer inferrer) {
+ TypeMask expectedReturnType, TypesInferrer inferrer) {
for (ParameterElement parameter in function.parameters) {
TypeMask type = inferrer.getTypeOfElement(parameter);
- Expect.equals(expectedParameterType, simplify(type, compiler),
- "$parameter");
+ Expect.equals(
+ expectedParameterType, simplify(type, compiler), "$parameter");
}
if (expectedReturnType != null) {
TypeMask type = inferrer.getReturnTypeOfElement(function);
- Expect.equals(expectedReturnType, simplify(type, compiler),
- "$function");
+ Expect.equals(
+ expectedReturnType, simplify(type, compiler), "$function");
}
}
void test(String name,
- {bool expectNoInline: false,
- bool expectTrustTypeAnnotations: false,
- TypeMask expectedParameterType: null,
- TypeMask expectedReturnType: null,
- bool expectAssumeDynamic: false}) {
- Element method = compiler.mainApp.find(name);
- Expect.isNotNull(method);
- Expect.equals(
- expectNoInline,
- backend.annotations.noInline(method),
- "Unexpected annotation of @NoInline on '$method'.");
- Expect.equals(
- expectTrustTypeAnnotations,
- backend.annotations.trustTypeAnnotations(method),
- "Unexpected annotation of @TrustTypeAnnotations on '$method'.");
- Expect.equals(
- expectAssumeDynamic,
- backend.annotations.assumeDynamic(method),
- "Unexpected annotation of @AssumeDynamic on '$method'.");
- TypesInferrer inferrer = compiler.globalInference.typesInferrer;
- if (expectTrustTypeAnnotations && expectedParameterType != null) {
- testTypeMatch(method, expectedParameterType, expectedReturnType,
- inferrer);
- } else if (expectAssumeDynamic) {
- testTypeMatch(method,
- compiler.commonMasks.dynamicType, null, inferrer);
- }
+ {bool expectNoInline: false,
+ bool expectTrustTypeAnnotations: false,
+ TypeMask expectedParameterType: null,
+ TypeMask expectedReturnType: null,
+ bool expectAssumeDynamic: false}) {
+ Element method = compiler.mainApp.find(name);
+ Expect.isNotNull(method);
+ Expect.equals(expectNoInline, backend.annotations.noInline(method),
+ "Unexpected annotation of @NoInline on '$method'.");
+ Expect.equals(
+ expectTrustTypeAnnotations,
+ backend.annotations.trustTypeAnnotations(method),
+ "Unexpected annotation of @TrustTypeAnnotations on '$method'.");
+ Expect.equals(
+ expectAssumeDynamic,
+ backend.annotations.assumeDynamic(method),
+ "Unexpected annotation of @AssumeDynamic on '$method'.");
+ TypesInferrer inferrer = compiler.globalInference.typesInferrer;
+ if (expectTrustTypeAnnotations && expectedParameterType != null) {
+ testTypeMatch(
+ method, expectedParameterType, expectedReturnType, inferrer);
+ } else if (expectAssumeDynamic) {
+ testTypeMatch(method, compiler.commonMasks.dynamicType, null, inferrer);
+ }
}
TypeMask jsStringType = compiler.commonMasks.stringType;
TypeMask jsIntType = compiler.commonMasks.intType;
- TypeMask coreStringType = new TypeMask.subtype(
- compiler.coreClasses.stringClass, compiler.world);
+ TypeMask coreStringType =
+ new TypeMask.subtype(compiler.coreClasses.stringClass, compiler.world);
test('method');
test('methodAssumeDynamic', expectAssumeDynamic: true);
test('methodTrustTypeAnnotations',
- expectTrustTypeAnnotations: true,
- expectedParameterType: jsStringType);
+ expectTrustTypeAnnotations: true, expectedParameterType: jsStringType);
test('methodNoInline', expectNoInline: true);
test('methodNoInlineTrustTypeAnnotations',
- expectNoInline: true,
- expectTrustTypeAnnotations: true,
- expectedParameterType: jsStringType,
- expectedReturnType: jsIntType);
+ expectNoInline: true,
+ expectTrustTypeAnnotations: true,
+ expectedParameterType: jsStringType,
+ expectedReturnType: jsIntType);
test('methodAssumeDynamicTrustTypeAnnotations',
- expectAssumeDynamic: true,
- expectTrustTypeAnnotations: true,
- expectedParameterType: coreStringType);
-
+ expectAssumeDynamic: true,
+ expectTrustTypeAnnotations: true,
+ expectedParameterType: coreStringType);
});
}
« no previous file with comments | « tests/compiler/dart2js/expect_annotations2_test.dart ('k') | tests/compiler/dart2js/field_codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698