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

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

Issue 158083002: introduce web_components pkg for consolidated polyfills (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/web_components/pubspec.yaml ('k') | samples/third_party/todomvc/web/app/app.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:js' as js; 9 import 'dart:js' as js;
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
(...skipping 20 matching lines...) Expand all
31 expect(app is TodoList, true, reason: 'TodoList should be created'); 31 expect(app is TodoList, true, reason: 'TodoList should be created');
32 32
33 final root = app.shadowRoot; 33 final root = app.shadowRoot;
34 final newTodo = root.querySelector('#new-todo'); 34 final newTodo = root.querySelector('#new-todo');
35 expect(newTodo.placeholder, "What needs to be done?"); 35 expect(newTodo.placeholder, "What needs to be done?");
36 36
37 expect(app.modelId, 'model', reason: 'modelId is set via attribute'); 37 expect(app.modelId, 'model', reason: 'modelId is set via attribute');
38 38
39 // Validate the stylesheet was loaded 39 // Validate the stylesheet was loaded
40 if (js.context.hasProperty('ShadowDOMPolyfill')) { 40 if (js.context.hasProperty('ShadowDOMPolyfill')) {
41 final style = document.head.querySelector('style[ShadowCSSShim]'); 41 final style = document.head.querySelector('style[shim-shadowdom-css]');
42 expect(style.text, contains('\ntd-todos #todoapp {')); 42 expect(style.text, contains('\ntd-todos #todoapp {'));
43 } else { 43 } else {
44 final style = root.querySelector('style'); 44 final style = root.querySelector('style');
45 expect(style, isNotNull, reason: '<link> was replaced with <style>'); 45 expect(style, isNotNull, reason: '<link> was replaced with <style>');
46 expect(style.text, contains('\n#todoapp {')); 46 expect(style.text, contains('\n#todoapp {'));
47 } 47 }
48 48
49 // Validate a style got applied 49 // Validate a style got applied
50 var color = root.querySelector('#footer').getComputedStyle().color; 50 var color = root.querySelector('#footer').getComputedStyle().color;
51 expect(color, 'rgb(119, 119, 119)'); 51 expect(color, 'rgb(119, 119, 119)');
52 52
53 return onPropertyInit(model, 'items').then((_) { 53 return onPropertyInit(model, 'items').then((_) {
54 expect(model.items, [], reason: 'no items yet'); 54 expect(model.items, [], reason: 'no items yet');
55 expect(app.model, model, reason: 'model should be data-bound'); 55 expect(app.model, model, reason: 'model should be data-bound');
56 }); 56 });
57 }); 57 });
58 } 58 }
OLDNEW
« no previous file with comments | « pkg/web_components/pubspec.yaml ('k') | samples/third_party/todomvc/web/app/app.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698