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

Unified Diff: tests/compiler/dart2js_native/subclassing_super_call_test.dart

Issue 2383273002: Revert "Add native_testing library to mock @Native classes" (Closed)
Patch Set: Created 4 years, 3 months 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/subclassing_super_call_test.dart
diff --git a/tests/compiler/dart2js_native/subclassing_super_call_test.dart b/tests/compiler/dart2js_native/subclassing_super_call_test.dart
index be901127e4a86db21c1b317274faf18a118dc0b0..a3bb7f42eae3aa532ae40554b8b4a70fb5dfccf1 100644
--- a/tests/compiler/dart2js_native/subclassing_super_call_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_super_call_test.dart
@@ -2,8 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import "native_testing.dart";
-import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
+import "package:expect/expect.dart";
+import 'dart:_foreign_helper' show JS;
+import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
import 'dart:_interceptors'
show findInterceptorForType, findConstructorForNativeSubclassType;
@@ -52,6 +53,8 @@ makeBB = function(){return new BB;};
getBBPrototype = function(){return BB.prototype;};
""";
+var inscrutable;
+
testSuperOnNative() {
BB b1 = makeBB();
BB b2 = makeBB();
@@ -61,14 +64,14 @@ testSuperOnNative() {
JS('', '#(#)', constructor, b1);
JS('', '#(#)', constructor, b2);
- b1.text = confuse('one');
- b2.text = confuse('two');
+ b1.text = inscrutable('one');
+ b2.text = inscrutable('two');
- print('b1.text ${confuse(b1).text}');
- print('b2.text ${confuse(b2).text}');
+ print('b1.text ${inscrutable(b1).text}');
+ print('b2.text ${inscrutable(b2).text}');
- print('b1.foo() ${confuse(b1).foo()}');
- print('b2.foo() ${confuse(b2).foo()}');
+ print('b1.foo() ${inscrutable(b1).foo()}');
+ print('b2.foo() ${inscrutable(b2).foo()}');
Expect.equals('one', b1.text);
Expect.equals('two', b2.text);
@@ -76,14 +79,14 @@ testSuperOnNative() {
Expect.equals('foo:one', b1.foo());
Expect.equals('foo:two', b2.foo());
- confuse(b1).text = confuse('three');
- confuse(b2).text = confuse('four');
+ inscrutable(b1).text = inscrutable('three');
+ inscrutable(b2).text = inscrutable('four');
- Expect.equals('three', confuse(b1).text);
- Expect.equals('four', confuse(b2).text);
+ Expect.equals('three', inscrutable(b1).text);
+ Expect.equals('four', inscrutable(b2).text);
- Expect.equals('foo:three', confuse(b1).foo());
- Expect.equals('foo:four', confuse(b2).foo());
+ Expect.equals('foo:three', inscrutable(b1).foo());
+ Expect.equals('foo:four', inscrutable(b2).foo());
}
testSuperOnSubclassOfNative() {
@@ -95,14 +98,14 @@ testSuperOnSubclassOfNative() {
JS('', '#(#)', constructor, b1);
JS('', '#(#)', constructor, b2);
- b1.afield = confuse('one');
- b2.afield = confuse('two');
+ b1.afield = inscrutable('one');
+ b2.afield = inscrutable('two');
- print('b1.afield ${confuse(b1).afield}');
- print('b2.afield ${confuse(b2).afield}');
+ print('b1.afield ${inscrutable(b1).afield}');
+ print('b2.afield ${inscrutable(b2).afield}');
- print('b1.afun() ${confuse(b1).afun()}');
- print('b2.afun() ${confuse(b2).afun()}');
+ print('b1.afun() ${inscrutable(b1).afun()}');
+ print('b2.afun() ${inscrutable(b2).afun()}');
Expect.equals('one', b1.afield);
Expect.equals('two', b2.afield);
@@ -110,19 +113,19 @@ testSuperOnSubclassOfNative() {
Expect.equals('afun:one', b1.afun());
Expect.equals('afun:two', b2.afun());
- confuse(b1).afield = confuse('three');
- confuse(b2).afield = confuse('four');
+ inscrutable(b1).afield = inscrutable('three');
+ inscrutable(b2).afield = inscrutable('four');
- Expect.equals('three', confuse(b1).afield);
- Expect.equals('four', confuse(b2).afield);
+ Expect.equals('three', inscrutable(b1).afield);
+ Expect.equals('four', inscrutable(b2).afield);
- Expect.equals('afun:three', confuse(b1).afun());
- Expect.equals('afun:four', confuse(b2).afun());
+ Expect.equals('afun:three', inscrutable(b1).afun());
+ Expect.equals('afun:four', inscrutable(b2).afun());
}
main() {
- nativeTesting();
setup();
+ inscrutable = (x) => x;
setNativeSubclassDispatchRecord(getBBPrototype(), findInterceptorForType(BB));

Powered by Google App Engine
This is Rietveld 408576698