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

Side by Side Diff: test/data/input/if_attribute_test.html

Issue 12225039: Support for observable models, fixes #259 (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: Created 7 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
« no previous file with comments | « test/data/input/html_escape_test.html ('k') | test/data/input/if_children_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 for details. All rights reserved. Use of this source code is governed by a 4 for details. All rights reserved. Use of this source code is governed by a
5 BSD-style license that can be found in the LICENSE file. 5 BSD-style license that can be found in the LICENSE file.
6 --> 6 -->
7 <html lang="en"> 7 <html lang="en">
8 <head> 8 <head>
9 <meta charset="utf-8"> 9 <meta charset="utf-8">
10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
11 <script type="application/javascript" src="testing.js"></script> 11 <script type="application/javascript" src="testing.js"></script>
12 </head> 12 </head>
13 <body> 13 <body>
14 <!-- Tests the iterate attribute on a node. --> 14 <!-- Tests the iterate attribute on a node. -->
15 <div id='test' template if="x == 3">{{x}}</div> 15 <div id='test' template if="x == 3">{{x}}</div>
16 <script type="application/dart"> 16 <script type="application/dart">
17 import 'dart:html'; 17 import 'dart:html';
18 import 'package:unittest/unittest.dart'; 18 import 'package:unittest/unittest.dart';
19 import 'package:web_ui/watcher.dart'; 19 import 'package:web_ui/observe.dart';
20 var x = 2; 20 @observable var x = 2;
21 21
22 main() { 22 main() {
23 window.setTimeout(() { 23 window.setTimeout(() {
24 expect(document.query('#test'), isNull); 24 expect(document.query('#test'), isNull);
25 var placeholder = document.body.query('div#__e-1'); 25 var placeholder = document.body.query('div#__e-1');
26 expect(placeholder, isNotNull); 26 expect(placeholder, isNotNull);
27 expect(placeholder.style.display, equals('none')); 27 expect(placeholder.style.display, equals('none'));
28 x = 3; 28 x = 3;
29 dispatch();
30 window.setTimeout(() { 29 window.setTimeout(() {
31 var div = document.query('#test'); 30 var div = document.query('#test');
32 expect(div, isNotNull); 31 expect(div, isNotNull);
33 expect(div.innerHtml, equals('3')); 32 expect(div.innerHtml, equals('3'));
34 expect(div.previousNode, same(placeholder)); 33 expect(div.previousNode, same(placeholder));
35 window.setTimeout(() => window.postMessage('done', '*'), 0); 34 window.setImmediate(() => window.postMessage('done', '*'));
36 }, 0); 35 }, 0);
37 }, 0); 36 }, 0);
38 } 37 }
39 </script> 38 </script>
40 </body> 39 </body>
41 </html> 40 </html>
OLDNEW
« no previous file with comments | « test/data/input/html_escape_test.html ('k') | test/data/input/if_children_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698