OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Suite of tests for shared cr elements. Currently: | 6 * @fileoverview Suite of tests for shared cr elements. Currently: |
7 * <cr-toolbar-search-field>. | 7 * <cr-toolbar-search-field>. |
8 */ | 8 */ |
9 | 9 |
10 /** @const {string} Path to source root. */ | 10 /** @const {string} Path to source root. */ |
(...skipping 18 matching lines...) Expand all Loading... |
29 TEST_F('CrElementsBrowserTest', 'CrToolbarSearchFieldTest', function() { | 29 TEST_F('CrElementsBrowserTest', 'CrToolbarSearchFieldTest', function() { |
30 suite('cr-toolbar-search-field', function() { | 30 suite('cr-toolbar-search-field', function() { |
31 /** @type {?CrToolbarSearchFieldElement} */ | 31 /** @type {?CrToolbarSearchFieldElement} */ |
32 var field; | 32 var field; |
33 /** @type {?MockSearchFieldDelegate} */ | 33 /** @type {?MockSearchFieldDelegate} */ |
34 var delegate; | 34 var delegate; |
35 | 35 |
36 /** @param {string} term */ | 36 /** @param {string} term */ |
37 function simulateSearch(term) { | 37 function simulateSearch(term) { |
38 field.$.searchInput.bindValue = term; | 38 field.$.searchInput.bindValue = term; |
39 field.onSearchTermSearch_(); | 39 field.onSearchTermSearch(); |
40 } | 40 } |
41 | 41 |
42 /** | 42 /** |
43 * @constructor | 43 * @constructor |
44 * @implements {SearchFieldDelegate} | 44 * @implements {SearchFieldDelegate} |
45 */ | 45 */ |
46 function MockSearchFieldDelegate() { | 46 function MockSearchFieldDelegate() { |
47 /** @type {!Array<string>} */ | 47 /** @type {!Array<string>} */ |
48 this.searches = []; | 48 this.searches = []; |
49 } | 49 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 MockInteractions.tap(field); | 110 MockInteractions.tap(field); |
111 simulateSearch('test'); | 111 simulateSearch('test'); |
112 MockInteractions.blur(field.$.searchInput); | 112 MockInteractions.blur(field.$.searchInput); |
113 | 113 |
114 assertTrue(field.showingSearch); | 114 assertTrue(field.showingSearch); |
115 }); | 115 }); |
116 }); | 116 }); |
117 | 117 |
118 mocha.run(); | 118 mocha.run(); |
119 }); | 119 }); |
OLD | NEW |