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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/dom/GeolocationTest.dart
diff --git a/LayoutTests/dart/dom/GeolocationTest.dart b/LayoutTests/dart/dom/GeolocationTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3b5763fc9d3ae9bf59410027c1ea313b5819d8ad
--- /dev/null
+++ b/LayoutTests/dart/dom/GeolocationTest.dart
@@ -0,0 +1,44 @@
+library GeolocationTest;
+
+import 'package:expect/expect.dart';
+import 'package:unittest/html_config.dart';
+import 'package:unittest/unittest.dart';
+import 'dart:async';
+import 'dart:html';
+
+main() {
+ useHtmlConfiguration(true);
+
+ errorCallback(error) =>
+ Expect.fail('${error.error.code}: ${error.error.message}');
+
+ // TODO(14150): This delay should not be necessary.
+ setUp(() => new Future.delayed(Duration.ZERO));
+
+ test('geolocation.getCurrentPosition', () {
+ final geolocation = window.navigator.geolocation;
+
+ geolocation.getCurrentPosition().then(expectAsync((posA) {
+ Timer.run(expectAsync(() {
+ geolocation.getCurrentPosition().then(expectAsync((posB) {
+ Expect.equals(posA.coords.longitude, posB.coords.longitude);
+ })).catchError(errorCallback);
+ }));
+ })).catchError(errorCallback);
+ });
+
+ test('geolocation.watchPosition', () {
+ final geolocation = window.navigator.geolocation;
+
+ var posA;
+ return geolocation.getCurrentPosition().then((position) {
+ posA = position;
+ // TODO(14150): This delay should not be necessary.
+ return new Future.delayed(Duration.ZERO);
+ }).then((_) {
+ return geolocation.watchPosition().first;
+ }).then((posB) {
+ Expect.equals(posA.coords.longitude, posB.coords.longitude);
+ });
+ });
+}
« 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