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

Unified Diff: chrome/test/data/webui/settings/search_settings_test.js

Issue 2739323005: MD Settings: Allow search within settings to track multiple requests separately. (Closed)
Patch Set: Fix test error. Created 3 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 side-by-side diff with in-line comments
Download patch
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);
+ });
+ });
});
});

Powered by Google App Engine
This is Rietveld 408576698