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

Unified Diff: tests/compiler/dart2js_native/native_class_avoids_hidden_name_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_class_avoids_hidden_name_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart b/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
index 8690e4b856605d04c7a158b4e22c72d49e67fdd0..3f286822d7304c01f0696579be69a63ffa78bfee 100644
--- a/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
@@ -2,8 +2,7 @@
// 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 "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
// Test that hidden native class names are not used by generated code.
@@ -41,18 +40,18 @@ function BB(){}
function CC(){}
makeA = function(){return new BB}; // AA is native "BB"
makeB = function(){return new CC}; // BB is native "CC"
+self.nativeConstructor(BB);
+self.nativeConstructor(CC);
""";
-int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
-
main() {
+ nativeTesting();
setup1();
setup2();
- var things = [AA.create(), BB.create(), CC.create()];
- var a = things[inscrutable(0)];
- var b = things[inscrutable(1)];
- var c = things[inscrutable(2)];
+ var a = confuse(AA.create());
+ var b = confuse(BB.create());
+ var c = confuse(CC.create());
Expect.equals('AA', a.name);
Expect.equals('BB', b.name);

Powered by Google App Engine
This is Rietveld 408576698