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

Side by Side Diff: samples/third_party/todomvc/test/mainpage_test.dart

Issue 27518006: Practically remove boot.js, adds the initialization from the Dart side of (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library todomvc.test.mainpage_test; 5 library todomvc.test.mainpage_test;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
9 import 'package:unittest/html_config.dart'; 9 import 'package:unittest/html_config.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
11 import '../web/app.dart'; 11 import '../web/app.dart';
12 import '../web/model.dart'; 12 import '../web/model.dart';
13 13
14 /** 14 /**
15 * This test runs the TodoMVC app and checks the state of the initial page. 15 * This test runs the TodoMVC app and checks the state of the initial page.
16 */ 16 */
17 // TODO(jmesserly): verify some styles (colors, fonts, relative size) as well. 17 // TODO(jmesserly): verify some styles (colors, fonts, relative size) as well.
18 main() { 18 @initMethod _main() {
19 useHtmlConfiguration(); 19 useHtmlConfiguration();
20 20
21 setUp(() => Polymer.onReady); 21 setUp(() => Polymer.onReady);
22 22
23 test('initial state', () { 23 test('initial state', () {
24 final todoApp = query('todo-app'); 24 final todoApp = query('todo-app');
25 expect(appModel.todos.length, 0); 25 expect(appModel.todos.length, 0);
26 expect(todoApp.xtag is TodoApp, true, reason: 'TodoApp should be created'); 26 expect(todoApp.xtag is TodoApp, true, reason: 'TodoApp should be created');
27 27
28 final root = todoApp.shadowRoot; 28 final root = todoApp.shadowRoot;
29 final newTodo = root.query('#new-todo'); 29 final newTodo = root.query('#new-todo');
30 expect(newTodo.placeholder, "What needs to be done?"); 30 expect(newTodo.placeholder, "What needs to be done?");
31 31
32 // TODO(jmesserly): re-enable this. It fails on Firefox with ShadowDOM. 32 // TODO(jmesserly): re-enable this. It fails on Firefox with ShadowDOM.
33 // The issue appears to be that 33 // The issue appears to be that
34 // Wait for setTimeout 0 for focus to activate. 34 // Wait for setTimeout 0 for focus to activate.
35 /*Timer.run(expectAsync0(() { 35 /*Timer.run(expectAsync0(() {
36 expect(document.activeElement, todoApp, reason: 'app should have focus'); 36 expect(document.activeElement, todoApp, reason: 'app should have focus');
37 expect(root.activeElement, newTodo, reason: 'New todo should have focus'); 37 expect(root.activeElement, newTodo, reason: 'New todo should have focus');
38 expect(root.queryAll('[is=todo-row]').length, 0, reason: 'no items yet'); 38 expect(root.queryAll('[is=todo-row]').length, 0, reason: 'no items yet');
39 }));*/ 39 }));*/
40 }); 40 });
41 } 41 }
OLDNEW
« no previous file with comments | « samples/third_party/todomvc/test/listorder_test.html ('k') | samples/third_party/todomvc/test/mainpage_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698