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

Unified Diff: tests/compiler/dart2js_native/subclassing_5_test.dart

Issue 2379173002: Add native_testing library to mock @Native classes (Closed)
Patch Set: xxx Created 4 years, 1 month 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_native/subclassing_5_test.dart
diff --git a/tests/compiler/dart2js_native/subclassing_5_test.dart b/tests/compiler/dart2js_native/subclassing_5_test.dart
index 7985893881850b4ae58ac14b313d70af1a451556..26a46550183bcec7e4cee1900167c4baba1f1057 100644
--- a/tests/compiler/dart2js_native/subclassing_5_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_5_test.dart
@@ -2,8 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
import 'dart:_interceptors' show Interceptor, findInterceptorForType;
// Test type checks.
@@ -121,51 +121,49 @@ testCastB(x) {
Expect.identical(x, z);
}
-var inscrutable;
-
main() {
+ nativeTesting();
setup();
- inscrutable = (x) => x;
setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
- var b = inscrutable(makeB());
+ var b = confuse(makeB());
- inscrutable(testIsB)(b);
- inscrutable(testIsA)(b);
- inscrutable(testIsN)(b);
- inscrutable(testIsM)(b);
- inscrutable(testIsI)(b);
+ confuse(testIsB)(b);
+ confuse(testIsA)(b);
+ confuse(testIsN)(b);
+ confuse(testIsM)(b);
+ confuse(testIsI)(b);
- inscrutable(new Checks<B>().isCheck)(b);
- inscrutable(new Checks<A>().isCheck)(b);
- inscrutable(new Checks<N>().isCheck)(b);
- inscrutable(new Checks<M>().isCheck)(b);
- inscrutable(new Checks<I>().isCheck)(b);
+ confuse(new Checks<B>().isCheck)(b);
+ confuse(new Checks<A>().isCheck)(b);
+ confuse(new Checks<N>().isCheck)(b);
+ confuse(new Checks<M>().isCheck)(b);
+ confuse(new Checks<I>().isCheck)(b);
if (isCheckedMode()) {
- inscrutable(testAssignB)(b);
- inscrutable(testAssignA)(b);
- inscrutable(testAssignN)(b);
- inscrutable(testAssignM)(b);
- inscrutable(testAssignI)(b);
-
- inscrutable(testCastB)(b);
- inscrutable(testCastA)(b);
- inscrutable(testCastN)(b);
- inscrutable(testCastM)(b);
- inscrutable(testCastI)(b);
-
- inscrutable(new Checks<B>().assignCheck)(b);
- inscrutable(new Checks<A>().assignCheck)(b);
- inscrutable(new Checks<N>().assignCheck)(b);
- inscrutable(new Checks<M>().assignCheck)(b);
- inscrutable(new Checks<I>().assignCheck)(b);
-
- inscrutable(new Checks<B>().castCheck)(b);
- inscrutable(new Checks<A>().castCheck)(b);
- inscrutable(new Checks<N>().castCheck)(b);
- inscrutable(new Checks<M>().castCheck)(b);
- inscrutable(new Checks<I>().castCheck)(b);
+ confuse(testAssignB)(b);
+ confuse(testAssignA)(b);
+ confuse(testAssignN)(b);
+ confuse(testAssignM)(b);
+ confuse(testAssignI)(b);
+
+ confuse(testCastB)(b);
+ confuse(testCastA)(b);
+ confuse(testCastN)(b);
+ confuse(testCastM)(b);
+ confuse(testCastI)(b);
+
+ confuse(new Checks<B>().assignCheck)(b);
+ confuse(new Checks<A>().assignCheck)(b);
+ confuse(new Checks<N>().assignCheck)(b);
+ confuse(new Checks<M>().assignCheck)(b);
+ confuse(new Checks<I>().assignCheck)(b);
+
+ confuse(new Checks<B>().castCheck)(b);
+ confuse(new Checks<A>().castCheck)(b);
+ confuse(new Checks<N>().castCheck)(b);
+ confuse(new Checks<M>().castCheck)(b);
+ confuse(new Checks<I>().castCheck)(b);
}
}

Powered by Google App Engine
This is Rietveld 408576698