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

Unified Diff: dart/tests/compiler/dart2js_foreign/native_class_inheritance3_test.dart

Issue 23477028: Remove dart2js_foreign. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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: dart/tests/compiler/dart2js_foreign/native_class_inheritance3_test.dart
diff --git a/dart/tests/compiler/dart2js_foreign/native_class_inheritance3_test.dart b/dart/tests/compiler/dart2js_foreign/native_class_inheritance3_test.dart
deleted file mode 100644
index 73794c899c5eebbcfe9a21a6c3c8dffbc22c9e18..0000000000000000000000000000000000000000
--- a/dart/tests/compiler/dart2js_foreign/native_class_inheritance3_test.dart
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-// Test to see if resolving a hidden native class's method to noSuchMethod
-// interferes with subsequent resolving of the method. This might happen if the
-// noSuchMethod is cached on Object.prototype.
-
-import "package:expect/expect.dart";
-import 'native_metadata.dart';
-
-@Native("*A1")
-class A1 {
-}
-
-@Native("*B1")
-class B1 extends A1 {
-}
-
-@native makeA1();
-@native makeB1();
-
-
-@Native("*A2")
-class A2 {
- @native foo([a=99]);
-}
-
-@Native("*B2")
-class B2 extends A2 {
-}
-
-@native makeA2();
-@native makeB2();
-
-@native makeObject();
-
-@Native("""
-// This code is all inside 'setup' and so not accesible from the global scope.
-function inherits(child, parent) {
- if (child.prototype.__proto__) {
- child.prototype.__proto__ = parent.prototype;
- } else {
- function tmp() {};
- tmp.prototype = parent.prototype;
- child.prototype = new tmp();
- child.prototype.constructor = child;
- }
-}
-function A1(){}
-function B1(){}
-inherits(B1, A1);
-
-makeA1 = function(){return new A1};
-makeB1 = function(){return new B1};
-
-function A2(){}
-function B2(){}
-inherits(B2, A2);
-A2.prototype.foo = function(a){return 'A2.foo(' + a + ')';}
-
-makeA2 = function(){return new A2};
-makeB2 = function(){return new B2};
-
-makeObject = function(){return new Object};
-""")
-void setup();
-
-
-main() {
- setup();
-
- var a1 = makeA1();
- var b1 = makeB1();
- var ob = makeObject();
-
- // Does calling missing methods in one tree of inheritance forest affect other
- // trees?
- expectNoSuchMethod(() => b1.foo(), 'b1.foo()');
- expectNoSuchMethod(() => a1.foo(), 'a1.foo()');
- expectNoSuchMethod(() => ob.foo(), 'ob.foo()');
-
- var a2 = makeA2();
- var b2 = makeB2();
-
- Expect.equals('A2.foo(99)', a2.foo());
- Expect.equals('A2.foo(99)', b2.foo());
- Expect.equals('A2.foo(1)', a2.foo(1));
- Expect.equals('A2.foo(2)', b2.foo(2));
-
-
- expectNoSuchMethod(() => b1.foo(3), 'b1.foo(3)');
- expectNoSuchMethod(() => a1.foo(4), 'a1.foo(4)');
-}
-
-expectNoSuchMethod(action, note) {
- bool caught = false;
- try {
- action();
- } catch (ex) {
- caught = true;
- Expect.isTrue(ex is NoSuchMethodError, note);
- }
- Expect.isTrue(caught, note);
-}

Powered by Google App Engine
This is Rietveld 408576698