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

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: Address comments. 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
« no previous file with comments | « chrome/test/data/webui/settings/basic_page_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..38f2f159a8592bbf5ab36c667be27f1bef3c47a2 100644
--- a/chrome/test/data/webui/settings/search_settings_test.js
+++ b/chrome/test/data/webui/settings/search_settings_test.js
@@ -98,5 +98,36 @@ 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() {
+ 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);
+ });
+ });
});
});
« no previous file with comments | « chrome/test/data/webui/settings/basic_page_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698