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

Unified Diff: tests/compiler/dart2js_native/native_null_closure_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_null_closure_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
index ec6f8d5671b2ac589abbc0b82aaa97a2af23b72b..7f19e1e6bc5e34f8a50972f8a72f14cc0c4ddd33 100644
--- a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
@@ -4,9 +4,7 @@
// Test that exception unwrapping handle cases like ({foo:null}).foo().
-import "dart:_js_helper";
-
-import "package:expect/expect.dart";
+import "native_testing.dart";
typedef void MyFunctionType();
@@ -25,9 +23,12 @@ A.prototype.setClosure = function(f) { this.f = f; };
A.prototype.check = function(f) { return this.f === f; };
A.prototype.invoke = function() { return this.f(); };
makeA = function(){return new A;};
+
+self.nativeConstructor(A);
""";
main() {
+ nativeTesting();
setup();
A a = makeA();
a.setClosure(null);
@@ -35,7 +36,7 @@ main() {
bool caughtException = false;
try {
a.invoke();
- } on JsNoSuchMethodError catch (e) {
+ } on NoSuchMethodError catch (e) {
print(e);
caughtException = true;
}
« no previous file with comments | « tests/compiler/dart2js_native/native_novel_html_test.dart ('k') | tests/compiler/dart2js_native/native_null_frog_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698