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

Unified Diff: test/data/input/custom_radio_button_test.html

Issue 11416259: fix #136, support watch exprs and two way bindings for component fields (Closed) Base URL: https://github.com/dart-lang/dart-web-components.git@master
Patch Set: Created 8 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
« no previous file with comments | « test/data/input/component_field_test.html ('k') | test/data/input/data_value_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/data/input/custom_radio_button_test.html
diff --git a/test/data/input/radio_button_test.html b/test/data/input/custom_radio_button_test.html
similarity index 74%
copy from test/data/input/radio_button_test.html
copy to test/data/input/custom_radio_button_test.html
index d2cb97f520c246a316f47a3e1b07944f66160508..898541f3ea36fe5716e71f325a75ce865bc3ce9b 100644
--- a/test/data/input/radio_button_test.html
+++ b/test/data/input/custom_radio_button_test.html
@@ -12,9 +12,27 @@ BSD-style license that can be found in the LICENSE file.
<script type='application/javascript' src="testing.js"></script>
</head>
<body>
+ <element name="x-my-input" extends="input">
+ <template></template>
+ <script type="application/dart">
+ import 'package:web_components/web_components.dart';
+ class MyInput extends WebComponent {
+ int clicked;
+ created() {
+ clicked = 0;
+ }
+ inserted() {
+ on.click.add((e) { clicked++; });
+ }
+ }
+ </script>
+ </element>
<form>
- <input name="a" type="radio" value="Foo" bind-value="name">Foo!
- <input name="a" type="radio" value="Bar" bind-value="name">Bar!
+ <!-- TODO(jmesserly): if fix #82 we can use <x-my-input> tags. -->
+ <input is="x-my-input" name="a" type="radio" value="Foo" bind-value="name">
+ Foo!
+ <input is="x-my-input" name="a" type="radio" value="Bar" bind-value="name">
+ Bar!
</form>
<pre>You picked {{name}}. Final value should be 'Bar'</pre>
<script type="application/dart">
@@ -49,11 +67,15 @@ BSD-style license that can be found in the LICENSE file.
expect(bar.checked, false, reason: 'foo picked.');
expect(name, 'Foo');
+ expect(foo.xtag.clicked, 0);
+ expect(bar.xtag.clicked, 0);
bar.on.click.dispatch(
new MouseEvent('click', window, 1, 0, 0, 0, 0, 0));
expect(name, 'Bar', reason: 'bar clicked.');
expect(foo.checked, false, reason: 'bar clicked.');
expect(bar.checked, true, reason: 'bar clicked.');
+ expect(foo.xtag.clicked, 0);
+ expect(bar.xtag.clicked, 1);
foo.checked = true;
expect(bar.checked, false, reason: 'only one can be checked.');
« no previous file with comments | « test/data/input/component_field_test.html ('k') | test/data/input/data_value_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698