Chromium Code Reviews| Index: samples/third_party/todomvc_performance/web/performance.dart |
| diff --git a/samples/third_party/todomvc_performance/web/performance.dart b/samples/third_party/todomvc_performance/web/performance.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..94cd17958ece225828d73f207bc725df7d98941e |
| --- /dev/null |
| +++ b/samples/third_party/todomvc_performance/web/performance.dart |
| @@ -0,0 +1,31 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
|
Jennifer Messerly
2014/03/19 19:27:57
not a big deal but could be 2014 :)
Emily Fortuna
2014/03/24 19:45:56
Done.
|
| +// 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. |
| + |
| +library todomvc.test.markdone_test; |
|
Jennifer Messerly
2014/03/19 19:27:57
change library name?
Emily Fortuna
2014/03/24 19:45:56
Done.
|
| + |
| +import 'dart:async'; |
| +import 'dart:html'; |
| +import 'dart:js' as js; |
| +import 'package:polymer/polymer.dart'; |
| +import 'package:web_components/polyfill.dart'; |
| +import 'elements/td_model.dart'; |
| + |
| +/** |
| + * This test determines how fast the TodoMVC app has loaded. |
| + */ |
| +main() { |
| + initPolymer(); |
| + customElementsReady.then((_) { |
| + var endInitTime = new DateTime.now(); |
| + window.postMessage(endInitTime.millisecondsSinceEpoch, '*'); |
| + }); |
| + |
| + // Failover case; sometimes in the Dartium version, customElementsReady has |
| + // already fired before Dart starts to run. allows the test to complete for |
| + // that state. |
| + Polymer.onReady.then((_) { |
|
Jennifer Messerly
2014/03/19 19:27:57
fyi -- I think this event is always more reliable
Emily Fortuna
2014/03/24 19:45:56
Done.
|
| + var endInitTime = new DateTime.now(); |
| + window.postMessage(endInitTime.millisecondsSinceEpoch, '*'); |
| + }); |
| +} |