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

Side by Side Diff: dom/GeolocationTest.dart

Issue 12221052: Remove use of deprecated test methods (asynctTest/callbackDone/expectThrows). Base URL: http://src.chromium.org/multivm/trunk/webkit/LayoutTests/dart/
Patch Set: Created 7 years, 10 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 unified diff | Download patch
« no previous file with comments | « Multiscript.html ('k') | dom/Workers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('GeolocationTest'); 1 #library('GeolocationTest');
2 #import("../../../../../dart/pkg/unittest/lib/unittest.dart"); 2 #import("../../../../../dart/pkg/unittest/lib/unittest.dart");
3 #import("../../../../../dart/pkg/unittest/lib/html_config.dart"); 3 #import("../../../../../dart/pkg/unittest/lib/html_config.dart");
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 main() { 6 main() {
7 useHtmlConfiguration(true); 7 useHtmlConfiguration(true);
8 8
9 errorCallback(error) => Expect.fail('${error.code}: ${error.message}'); 9 errorCallback(error) => Expect.fail('${error.code}: ${error.message}');
10 10
11 asyncTest('geolocation.getCurrentPosition', 1, () { 11 test('geolocation.getCurrentPosition', () {
12 final geolocation = window.navigator.geolocation; 12 final geolocation = window.navigator.geolocation;
13 13
14 geolocation.getCurrentPosition((posA) { 14 geolocation.getCurrentPosition(expectAsync1((posA) {
15 window.setTimeout(() { 15 window.setTimeout(expectAsync0(() {
16 geolocation.getCurrentPosition((posB) { 16 geolocation.getCurrentPosition(expectAsync1((posB) {
17 Expect.equals(posA.coords.longitude, posB.coords.longitude); 17 Expect.equals(posA.coords.longitude, posB.coords.longitude);
18 callbackDone(); 18 }), errorCallback);
19 }, errorCallback); 19 }), 0);
20 }, 0); 20 }), errorCallback);
21 }, errorCallback);
22 }); 21 });
23 22
24 asyncTest('geolocation.watchPosition', 1, () { 23 test('geolocation.watchPosition', () {
25 final geolocation = window.navigator.geolocation; 24 final geolocation = window.navigator.geolocation;
26 25
27 geolocation.getCurrentPosition((posA) { 26 geolocation.getCurrentPosition(expectAsync1((posA) {
28 window.setTimeout(() { 27 window.setTimeout(expectAsync0(() {
29 geolocation.watchPosition((posB) { 28 geolocation.watchPosition(expectAsync1((posB) {
30 Expect.equals(posA.coords.longitude, posB.coords.longitude); 29 Expect.equals(posA.coords.longitude, posB.coords.longitude);
31 callbackDone(); 30 }), errorCallback);
32 }, errorCallback); 31 }), 0);
33 }, 0); 32 }), errorCallback);
34 }, errorCallback);
35 }); 33 });
36 } 34 }
OLDNEW
« no previous file with comments | « Multiscript.html ('k') | dom/Workers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698