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

Unified Diff: frog/tests/frog_native/native_method_rename1_frog_test.dart

Issue 10536169: Move frog/tests/{leg,leg_only,frog_native} to tests/compiler/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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: frog/tests/frog_native/native_method_rename1_frog_test.dart
===================================================================
--- frog/tests/frog_native/native_method_rename1_frog_test.dart (revision 8644)
+++ frog/tests/frog_native/native_method_rename1_frog_test.dart (working copy)
@@ -1,71 +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 the feature where the native string declares the native method's name.
-
-class A native "*A" {
- int foo() native 'fooA';
- int bar() native 'barA';
- int baz() native 'bazA';
-}
-
-A makeA() native;
-
-class B {
- int bar([x]) => 800;
- int baz() => 900;
-}
-
-void setup() native """
-// This code is all inside 'setup' and so not accesible from the global scope.
-function A(){}
-A.prototype.fooA = function(){return 100;};
-A.prototype.barA = function(){return 200;};
-A.prototype.bazA = function(){return 300;};
-
-makeA = function(){return new A};
-""";
-
-
-testDynamic() {
- setup();
-
- var things = [makeA(), new B()];
- var a = things[0];
- var b = things[1];
-
- Expect.equals(100, a.foo());
- Expect.equals(200, a.bar());
- Expect.equals(300, a.baz());
- Expect.equals(800, b.bar());
- Expect.equals(900, b.baz());
-}
-
-testTyped() {
- A a = makeA();
- B b = new B();
-
- Expect.equals(100, a.foo());
- Expect.equals(200, a.bar());
- Expect.equals(300, a.baz());
- Expect.equals(800, b.bar());
- Expect.equals(900, b.baz());
-}
-
-main() {
- setup();
- testDynamic();
- testTyped();
-}
-
-expectNoSuchMethod(action, note) {
- bool caught = false;
- try {
- action();
- } catch (var ex) {
- caught = true;
- Expect.isTrue(ex is NoSuchMethodException, note);
- }
- Expect.isTrue(caught, note);
-}

Powered by Google App Engine
This is Rietveld 408576698