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

Unified Diff: tests/compiler/dart2js_native/native_method_rename1_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_rename1_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
index e38cd2834094d601e43482b6228e7f066611dd20..4d8ead2bbf90af6b4293218f437fd699e728b49d 100644
--- a/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
@@ -4,7 +4,7 @@
// Test the feature where the native string declares the native method's name.
-import "package:expect/expect.dart";
+import 'native_testing.dart';
import 'dart:_js_helper' show Native, JSName;
@Native("A")
@@ -34,14 +34,13 @@ A.prototype.barA = function(){return 200;};
A.prototype.bazA = function(){return 300;};
makeA = function(){return new A};
+
+self.nativeConstructor(A);
""";
testDynamic() {
- setup();
-
- var things = [makeA(), new B()];
- var a = things[0];
- var b = things[1];
+ var a = confuse(makeA());
+ var b = confuse(new B());
Expect.equals(100, a.foo());
Expect.equals(200, a.bar());
@@ -62,6 +61,7 @@ testTyped() {
}
main() {
+ nativeTesting();
setup();
testDynamic();
testTyped();

Powered by Google App Engine
This is Rietveld 408576698