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

Unified Diff: tests/compiler/dart2js_native/native_library_same_name_used_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_library_same_name_used_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart b/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart
index 9f305f7692108acaebdf23bb3f8d432c9769aeb1..e90e9f4153451ff7eb605160ccefabacfe8a3c00 100644
--- a/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart
@@ -6,7 +6,7 @@
library main;
-import "package:expect/expect.dart";
+import 'native_testing.dart';
import 'native_library_same_name_used_lib1.dart';
void setup() native """
@@ -15,6 +15,7 @@ void setup() native """
I.prototype.read = function() { return this._x; };
I.prototype.write = function(x) { this._x = x; };
makeI = function(){return new I};
+ self.nativeConstructor(I);
""";
// A pure Dart implementation of I.
@@ -31,6 +32,7 @@ class ProxyI implements I {
}
main() {
+ nativeTesting();
setup();
var a1 = makeI();
@@ -47,4 +49,7 @@ main() {
Expect.isTrue(a1 is I, 'a1 is I');
Expect.isFalse(a1 is ProxyI, 'a1 is ProxyI');
+
+ Expect.isTrue(confuse(a1) is I, 'a1 is I');
+ Expect.isFalse(confuse(a1) is ProxyI, 'a1 is ProxyI');
}

Powered by Google App Engine
This is Rietveld 408576698