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

Side by Side Diff: LayoutTests/dart/dom/GeolocationTest.dart

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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 | « LayoutTests/dart/dom/Geolocation-expected.txt ('k') | LayoutTests/dart/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
(Empty)
1 library GeolocationTest;
2
3 import 'package:expect/expect.dart';
4 import 'package:unittest/html_config.dart';
5 import 'package:unittest/unittest.dart';
6 import 'dart:async';
7 import 'dart:html';
8
9 main() {
10 useHtmlConfiguration(true);
11
12 errorCallback(error) =>
13 Expect.fail('${error.error.code}: ${error.error.message}');
14
15 // TODO(14150): This delay should not be necessary.
16 setUp(() => new Future.delayed(Duration.ZERO));
17
18 test('geolocation.getCurrentPosition', () {
19 final geolocation = window.navigator.geolocation;
20
21 geolocation.getCurrentPosition().then(expectAsync((posA) {
22 Timer.run(expectAsync(() {
23 geolocation.getCurrentPosition().then(expectAsync((posB) {
24 Expect.equals(posA.coords.longitude, posB.coords.longitude);
25 })).catchError(errorCallback);
26 }));
27 })).catchError(errorCallback);
28 });
29
30 test('geolocation.watchPosition', () {
31 final geolocation = window.navigator.geolocation;
32
33 var posA;
34 return geolocation.getCurrentPosition().then((position) {
35 posA = position;
36 // TODO(14150): This delay should not be necessary.
37 return new Future.delayed(Duration.ZERO);
38 }).then((_) {
39 return geolocation.watchPosition().first;
40 }).then((posB) {
41 Expect.equals(posA.coords.longitude, posB.coords.longitude);
42 });
43 });
44 }
OLDNEW
« no previous file with comments | « LayoutTests/dart/dom/Geolocation-expected.txt ('k') | LayoutTests/dart/dom/Workers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698