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

Unified Diff: tests/compiler/dart2js_native/native_method_rename3_frog_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/native_method_rename3_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
index fcfd40bc224fb1224cd6fa2466a7ca293ea3204a..014e6690ff965665f7201f70625f674f58923ce9 100644
--- a/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
@@ -5,8 +5,7 @@
// Test the feature where the native string declares the native method's name.
// #3. The name does not get
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, JSName;
+import 'native_testing.dart';
@Native("A")
class A {
@@ -49,13 +48,15 @@ B.prototype.fooB = function(){return 200;};
makeA = function(){return new A};
makeB = function(){return new B};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
""";
testDynamic() {
- var things = [makeA(), makeB(), new Decoy()];
- var a = things[0];
- var b = things[1];
- var d = things[2];
+ var a = confuse(makeA());
+ var b = confuse(makeB());
+ var d = confuse(new Decoy());
Expect.equals(100, a.foo());
Expect.equals(200, b.foo());
@@ -87,6 +88,7 @@ testTyped() {
}
main() {
+ nativeTesting();
setup();
testDynamic();

Powered by Google App Engine
This is Rietveld 408576698