OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #library('touch_tests'); | 5 #library('touch_tests'); |
6 | 6 |
7 #import('dart:html'); // TODO(rnystrom): Only needed to tell architecture.py | 7 #import('dart:html'); // TODO(rnystrom): Only needed to tell architecture.py |
8 // that this is a web test. Come up with cleaner solution. | 8 // that this is a web test. Come up with cleaner solution. |
9 #import('../../../../../../client/testing/unittest/unittest.dart'); | 9 #import('../../../../../../client/testing/unittest/unittest_html.dart'); |
10 #import('../../../../../ui_lib/touch/touch.dart'); | 10 #import('../../../../../ui_lib/touch/touch.dart'); |
11 | 11 |
12 main() { | 12 main() { |
13 test('Solver', () { | 13 test('Solver', () { |
14 expect(Solver.solve((x) => x * x, 81, 10)).approxEquals(9); | 14 expect(Solver.solve((x) => x * x, 81, 10)).approxEquals(9); |
15 expect(Solver.solve((x) => x * x, 0, 10)).approxEquals(0); | 15 expect(Solver.solve((x) => x * x, 0, 10)).approxEquals(0); |
16 expect(Solver.solve((x) => x * x, 1.5625, 10)).approxEquals(1.25); | 16 expect(Solver.solve((x) => x * x, 1.5625, 10)).approxEquals(1.25); |
17 expect(Solver.solve((x) => 1 / x, 10, 1)).approxEquals(0.1); | 17 expect(Solver.solve((x) => 1 / x, 10, 1)).approxEquals(0.1); |
18 }); | 18 }); |
19 | 19 |
(...skipping 21 matching lines...) Expand all Loading... |
41 onDecelerateCallback(x, y, duration, timingFunction); | 41 onDecelerateCallback(x, y, duration, timingFunction); |
42 } | 42 } |
43 | 43 |
44 /** | 44 /** |
45 * Callback for end of deceleration. | 45 * Callback for end of deceleration. |
46 */ | 46 */ |
47 void onDecelerationEnd() { | 47 void onDecelerationEnd() { |
48 onDecelerationEndCallback(); | 48 onDecelerationEndCallback(); |
49 } | 49 } |
50 } | 50 } |
OLD | NEW |