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

Unified Diff: tests/lib/js/datetime_roundtrip_test.dart

Issue 180723004: Use Date.getTime instead of Date.getMilliseconds in dart:js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: tests/lib/js/datetime_roundtrip_test.dart
diff --git a/tests/lib/js/datetime_roundtrip_test.dart b/tests/lib/js/datetime_roundtrip_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..16cd6d0487923e8eb307cf767eff28d404e8d6ee
--- /dev/null
+++ b/tests/lib/js/datetime_roundtrip_test.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:js';
+import 'package:expect/expect.dart';
+
+main() {
+ var dt = new DateTime.now();
+ var jsArray = new JsObject.jsify([dt]);
+ var roundTripped = jsArray[0];
+ Expect.isTrue(roundTripped is DateTime);
+ Expect.equals(dt.millisecondsSinceEpoch, roundTripped.millisecondsSinceEpoch);
+}
« no previous file with comments | « sdk/lib/js/dart2js/js_dart2js.dart ('k') | tests/lib/lib.status » ('j') | tests/lib/lib.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698