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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-test-helpers/README.md

Issue 1766433002: Roll Polymer to 1.3.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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
OLDNEW
1 [![Build status](https://travis-ci.org/PolymerElements/iron-test-helpers.svg?bra nch=master)](https://travis-ci.org/PolymerElements/iron-test-helpers)
2
1 # iron-test-helpers 3 # iron-test-helpers
2 4
3 Utility classes to make testing easier. 5 A set of utility classes to make testing easier. For more details on the methods
6 available, please check the documentation of `mock-interactions.js` and
7 `test-helpers.js`
4 8
5 ## Mock Interactions 9 ## Mock Interactions
6 10
7 This is a set of methods to simulate mouse or keyboard interaction with an eleme nt. Include `mock-interactions.js` and then use them like so: 11 This is a set of methods to simulate mouse or keyboard interaction with an eleme nt. Include `mock-interactions.js` and then use them like so:
8 12
9 ```javascript 13 ```javascript
10 test('can be triggered with space', function(done) { 14 test('can be triggered with space', function(done) {
11 button.addEventListener('keydown', function() { 15 button.addEventListener('keydown', function() {
12 done(); 16 done();
13 }); 17 });
14 MockInteractions.pressSpace(button); 18 MockInteractions.pressSpace(button);
15 }); 19 });
16 20
17 test('can be clicked', function(done) { 21 test('can be clicked', function(done) {
18 button.addEventListener('click', function() { 22 button.addEventListener('click', function() {
19 done(); 23 done();
20 }); 24 });
21 MockInteractions.tap(button); 25 MockInteractions.tap(button);
22 }); 26 });
23 ``` 27 ```
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698