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

Unified Diff: tests/compiler/dart2js_native/core_type_check_native_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/core_type_check_native_test.dart
diff --git a/tests/compiler/dart2js_native/core_type_check_native_test.dart b/tests/compiler/dart2js_native/core_type_check_native_test.dart
index 261acf7f757db901afa2036b61c4d44218d4e9de..307509f5f9d55ff85fbf2b40d40cf77dc098685e 100644
--- a/tests/compiler/dart2js_native/core_type_check_native_test.dart
+++ b/tests/compiler/dart2js_native/core_type_check_native_test.dart
@@ -2,10 +2,7 @@
// 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 "dart:_js_helper";
-import "package:expect/expect.dart";
-
-var inscrutable = (int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
+import "native_testing.dart";
@Native("A")
class A {}
@@ -33,6 +30,11 @@ function C() {};
makeC = function() { return new C; }
function D() {};
makeD = function() { return new D; }
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
+self.nativeConstructor(C);
+self.nativeConstructor(D);
""";
checkTest(value, expectComparable, expectPattern) {
@@ -65,7 +67,7 @@ checkAll(check) {
makeC(),
makeD()
];
- value(i) => things[inscrutable(i)];
+ value(i) => confuse(things[i]);
check(value(0), false, false); // List
check(value(1), true, false); // int
@@ -79,6 +81,7 @@ checkAll(check) {
}
main() {
+ nativeTesting();
setup();
checkAll(checkTest);

Powered by Google App Engine
This is Rietveld 408576698