| Index: chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
|
| diff --git a/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js b/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
|
| index 750560cde7b5003d83fa28c98371400fd4d688fd..85ba39401be603932f8d5348c952885d27a37692 100644
|
| --- a/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
|
| +++ b/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
|
| @@ -93,6 +93,23 @@ cr.define('cr_toolbar_search_field', function() {
|
| assertEquals(['foo', '', 'bar', 'baz'].join(), searches.join());
|
| });
|
|
|
| + // Tests that calling setValue() from within a 'search-changed' callback
|
| + // does not result in an infinite loop.
|
| + test('no infinite loop', function() {
|
| + var counter = 0;
|
| + field.addEventListener('search-changed', function(event) {
|
| + counter++;
|
| + // Calling setValue() with the already existing value should not
|
| + // trigger another 'search-changed' event.
|
| + field.setValue(event.detail);
|
| + });
|
| +
|
| + MockInteractions.tap(field);
|
| + field.setValue('bar');
|
| + assertEquals(1, counter);
|
| + assertEquals(['bar'].join(), searches.join());
|
| + });
|
| +
|
| test('blur does not close field when a search is active', function() {
|
| MockInteractions.tap(field);
|
| simulateSearch('test');
|
|
|