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

Unified Diff: samples/third_party/todomvc/test/mainpage_test.dart

Issue 76013002: "Reverting 30387" -- failures on IE (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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: samples/third_party/todomvc/test/mainpage_test.dart
diff --git a/samples/third_party/todomvc/test/mainpage_test.dart b/samples/third_party/todomvc/test/mainpage_test.dart
index ecb656060d05eb666fae0a8d49212c528ec5012a..7b6d8f3b44d1e7c041ef974d01a4eee1d4f2528f 100644
--- a/samples/third_party/todomvc/test/mainpage_test.dart
+++ b/samples/third_party/todomvc/test/mainpage_test.dart
@@ -4,18 +4,17 @@
library todomvc.test.mainpage_test;
-import 'dart:async';
import 'dart:html';
import 'package:polymer/polymer.dart';
import 'package:unittest/html_config.dart';
import 'package:unittest/unittest.dart';
-import '../web/elements/td_model.dart';
-import '../web/elements/td_todos.dart';
-import 'utils.dart';
+import '../web/app.dart';
+import '../web/model.dart';
/**
* This test runs the TodoMVC app and checks the state of the initial page.
*/
+// TODO(jmesserly): verify some styles (colors, fonts, relative size) as well.
main() {
initPolymer();
useHtmlConfiguration();
@@ -23,30 +22,21 @@ main() {
setUp(() => Polymer.onReady);
test('initial state', () {
- final model = querySelector('td-model');
- expect(model is TodoModel, true, reason: 'TodoModel should be created');
+ final todoApp = querySelector('todo-app');
+ expect(appModel.todos.length, 0);
+ expect(todoApp.xtag is TodoApp, true, reason: 'TodoApp should be created');
- final app = querySelector('td-todos');
- expect(app is TodoList, true, reason: 'TodoList should be created');
-
- final root = app.shadowRoot;
+ final root = todoApp.shadowRoot;
final newTodo = root.querySelector('#new-todo');
expect(newTodo.placeholder, "What needs to be done?");
- expect(app.modelId, 'model', reason: 'modelId is set via attribute');
-
- // Validate the stylesheet was loaded
- final style = root.querySelector('style');
- expect(style, isNotNull, reason: '<link> was replaced with <style>');
- expect(style.text, contains("@media screen and"));
-
- // Validate a style got applied
- var color = root.querySelector('#footer').getComputedStyle().color;
- expect(color, 'rgb(119, 119, 119)');
-
- return onPropertyInit(model, 'items').then((_) {
- expect(model.items, [], reason: 'no items yet');
- expect(app.model, model, reason: 'model should be data-bound');
- });
+ // TODO(jmesserly): re-enable this. It fails on Firefox with ShadowDOM.
+ // The issue appears to be that
+ // Wait for setTimeout 0 for focus to activate.
+ /*Timer.run(expectAsync0(() {
+ expect(document.activeElement, todoApp, reason: 'app should have focus');
+ expect(root.activeElement, newTodo, reason: 'New todo should have focus');
+ expect(root.querySelectorAll('[is=todo-row]').length, 0, reason: 'no items yet');
+ }));*/
});
}
« 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