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

Unified Diff: tests/compiler/dart2js_native/native_exception2_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_exception2_test.dart
diff --git a/tests/compiler/dart2js_native/native_exception2_test.dart b/tests/compiler/dart2js_native/native_exception2_test.dart
index 44f89fba9757ed48bcb595fe5fb54bee0d72ad17..916709b2f185943c9ccda8751803e6d87ce76bb2 100644
--- a/tests/compiler/dart2js_native/native_exception2_test.dart
+++ b/tests/compiler/dart2js_native/native_exception2_test.dart
@@ -8,19 +8,24 @@
library native_exception2_test;
import 'native_exception_test.dart' as other;
-import 'dart:_js_helper';
+import 'native_testing.dart';
@Native("NativeClass")
-class NativeClass {}
+class NativeClass {
+ foo() => 'oof';
+}
makeNativeClass() native ;
setup() native """
function NativeClass() {}
makeNativeClass = function() { return new NativeClass; }
+self.nativeConstructor(NativeClass);
""";
main() {
+ nativeTesting();
setup();
+ Expect.equals('oof', makeNativeClass().foo());
other.main();
}
« no previous file with comments | « tests/compiler/dart2js_native/native_equals_frog_test.dart ('k') | tests/compiler/dart2js_native/native_exception_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698