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 '../../../../../pkg/unittest/unittest.dart'; | 9 #import('../../../../../pkg/unittest/unittest.dart'); |
10 import '../../../../../pkg/unittest/html_config.dart'; | 10 #import('../../../../../pkg/unittest/html_config.dart'); |
11 import '../../../../ui_lib/touch/touch.dart'; | 11 #import('../../../../ui_lib/touch/touch.dart'); |
12 | 12 |
13 main() { | 13 main() { |
14 useHtmlConfiguration(); | 14 useHtmlConfiguration(); |
15 test('Solver', () { | 15 test('Solver', () { |
16 expect(Solver.solve((x) => x * x, 81, 10)).approxEquals(9); | 16 expect(Solver.solve((x) => x * x, 81, 10)).approxEquals(9); |
17 expect(Solver.solve((x) => x * x, 0, 10)).approxEquals(0); | 17 expect(Solver.solve((x) => x * x, 0, 10)).approxEquals(0); |
18 expect(Solver.solve((x) => x * x, 1.5625, 10)).approxEquals(1.25); | 18 expect(Solver.solve((x) => x * x, 1.5625, 10)).approxEquals(1.25); |
19 expect(Solver.solve((x) => 1 / x, 10, 1)).approxEquals(0.1); | 19 expect(Solver.solve((x) => 1 / x, 10, 1)).approxEquals(0.1); |
20 }); | 20 }); |
21 | 21 |
(...skipping 21 matching lines...) Expand all Loading... |
43 onDecelerateCallback(x, y, duration, timingFunction); | 43 onDecelerateCallback(x, y, duration, timingFunction); |
44 } | 44 } |
45 | 45 |
46 /** | 46 /** |
47 * Callback for end of deceleration. | 47 * Callback for end of deceleration. |
48 */ | 48 */ |
49 void onDecelerationEnd() { | 49 void onDecelerationEnd() { |
50 onDecelerationEndCallback(); | 50 onDecelerationEndCallback(); |
51 } | 51 } |
52 } | 52 } |
OLD | NEW |