Chromium Code Reviews| Index: chrome/test/data/webui/settings/search_settings_test.js |
| diff --git a/chrome/test/data/webui/settings/search_settings_test.js b/chrome/test/data/webui/settings/search_settings_test.js |
| index 9653441b2605fad96299beb66b9ef9922faf5c6b..d593b9474df52d3df7318d90a9029896fdb2879f 100644 |
| --- a/chrome/test/data/webui/settings/search_settings_test.js |
| +++ b/chrome/test/data/webui/settings/search_settings_test.js |
| @@ -98,5 +98,37 @@ cr.define('settings_test', function() { |
| assertEquals('Baz', options[2].textContent); |
| }); |
| }); |
| + |
| + // Test that multiple requests for the same text correctly highlight their |
| + // corresponding part of the tree without affecting other parts of the tree. |
| + test('multiple simultaneous requests for the same text', function() { |
| + console.log('ssssstart test'); |
|
Dan Beam
2017/03/14 00:44:28
rrrrremove
dpapad
2017/03/14 03:28:11
Done.
|
| + document.body.innerHTML = |
| + `<settings-section hidden-by-search> |
| + <div><span>Hello there</span></div> |
| + </settings-section> |
| + <settings-section hidden-by-search> |
| + <div><span>Hello over there</span></div> |
| + </settings-section> |
| + <settings-section hidden-by-search> |
| + <div><span>Nothing</span></div> |
| + </settings-section>`; |
| + |
| + var sections = Array.prototype.slice.call( |
| + document.querySelectorAll('settings-section')); |
| + |
| + return Promise.all( |
| + sections.map(function(section) { |
| + return searchManager.search('there', section); |
| + }), |
| + ).then(function(requests) { |
| + assertTrue(requests[0].didFindMatches()); |
| + assertFalse(sections[0].hiddenBySearch); |
| + assertTrue(requests[1].didFindMatches()); |
| + assertFalse(sections[1].hiddenBySearch); |
| + assertFalse(requests[2].didFindMatches()); |
| + assertTrue(sections[2].hiddenBySearch); |
| + }); |
| + }); |
| }); |
| }); |