| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library polymer.test.web.events_test; |
| 6 |
| 7 import 'dart:html'; |
| 8 import 'dart:async'; |
| 9 import 'package:unittest/unittest.dart'; |
| 10 import 'package:unittest/html_config.dart'; |
| 11 |
| 12 main() { |
| 13 useHtmlConfiguration(); |
| 14 |
| 15 test('host event', () { |
| 16 // Note: this test is currently the only event in |
| 17 // polymer/test/js/events.js at commit #7936ff8 |
| 18 Timer.run(expectAsync0(() { |
| 19 var testA = query('#a'); |
| 20 expect(testA.xtag.clicks, isEmpty); |
| 21 testA.click(); |
| 22 expect(testA.xtag.clicks, ['host click on: test-a (id a)']); |
| 23 })); |
| 24 }); |
| 25 |
| 26 test('local event', () { |
| 27 Timer.run(expectAsync0(() { |
| 28 var testB = query('#b'); |
| 29 expect(testB.xtag.clicks, isEmpty); |
| 30 testB.click(); |
| 31 expect(testB.xtag.clicks, []); |
| 32 var b1 = testB.shadowRoot.query('#b-1'); |
| 33 b1.click(); |
| 34 expect(testB.xtag.clicks, []); |
| 35 var b2 = testB.shadowRoot.query('#b-2'); |
| 36 b2.click(); |
| 37 expect(testB.xtag.clicks, ['local click under test-b (id b) on b-2']); |
| 38 })); |
| 39 }); |
| 40 } |
| OLD | NEW |