| Index: tests/compiler/dart2js_native/browser_compat_2_test.dart
|
| diff --git a/tests/compiler/dart2js_native/browser_compat_2_test.dart b/tests/compiler/dart2js_native/browser_compat_2_test.dart
|
| index e659ce48075b8520af06874d77a479083e84b524..eeb87fa28d16f726cbf96995a838628af12d01f9 100644
|
| --- a/tests/compiler/dart2js_native/browser_compat_2_test.dart
|
| +++ b/tests/compiler/dart2js_native/browser_compat_2_test.dart
|
| @@ -2,7 +2,8 @@
|
| // 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";
|
| +import "package:expect/expect.dart";
|
|
|
| // Test for dartNativeDispatchHooksTransformer
|
| // - uncached, instance, leaf and interior caching modes.
|
| @@ -62,11 +63,6 @@ makeT1B = function(){return new T1B;};
|
| makeT1C = function(){return new T1C;};
|
| makeT1D = function(){return new T1D;};
|
|
|
| -self.nativeConstructor(T1A);
|
| -self.nativeConstructor(T1B);
|
| -self.nativeConstructor(T1C);
|
| -self.nativeConstructor(T1D);
|
| -
|
| var getTagCount = 0;
|
| getTagCallCount = function() { return getTagCount; }
|
| clearTagCallCount = function() { getTagCount = 0; }
|
| @@ -103,9 +99,11 @@ function transformer2(hooks) {
|
| dartNativeDispatchHooksTransformer = [transformer1, transformer2];
|
| ''';
|
|
|
| +var inscrutable;
|
| +
|
| main() {
|
| - nativeTesting();
|
| setup();
|
| + inscrutable = (x) => x;
|
|
|
| var t1a = makeT1A();
|
| var t1b = makeT1B();
|
| @@ -113,17 +111,17 @@ main() {
|
| var t1d = makeT1D();
|
|
|
| clearTagCallCount();
|
| - Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
|
| - Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
|
| - Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
|
| - Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
|
| + Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
|
| + Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
|
| + Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
|
| + Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
|
| Expect.equals(4, getTagCallCount(), '4 fresh instances / types');
|
|
|
| clearTagCallCount();
|
| - Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
|
| - Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
|
| - Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
|
| - Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
|
| + Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
|
| + Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
|
| + Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
|
| + Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
|
| Expect.equals(1, getTagCallCount(), '1 = 1 uncached + (3 cached)');
|
|
|
| t1a = makeT1A();
|
| @@ -132,18 +130,18 @@ main() {
|
| t1d = makeT1D();
|
|
|
| clearTagCallCount();
|
| - Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
|
| - Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
|
| - Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
|
| - Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
|
| + Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
|
| + Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
|
| + Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
|
| + Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
|
| Expect.equals(2, getTagCallCount(),
|
| '2 = 1 fresh instance + 1 uncached (+ 2 proto cached)');
|
|
|
| clearTagCallCount();
|
| - Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
|
| - Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
|
| - Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
|
| - Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
|
| + Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
|
| + Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
|
| + Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
|
| + Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
|
| Expect.equals(1, getTagCallCount(),
|
| '1 = 2 proto cached + 1 instance cached + 1 uncached');
|
| }
|
|
|