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

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

Issue 2774003002: MD Settings: Don't search inside <dialog> elements. (Closed)
Patch Set: 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 38f2f159a8592bbf5ab36c667be27f1bef3c47a2..ed58ec0b458837c01c23fafa3d26921ba6497495 100644
--- a/chrome/test/data/webui/settings/search_settings_test.js
+++ b/chrome/test/data/webui/settings/search_settings_test.js
@@ -99,6 +99,30 @@ cr.define('settings_test', function() {
});
});
+ test('ignored elements are ignored', function() {
+ var text = 'hello';
+ document.body.innerHTML =
+ `<settings-section hidden-by-search>
+ <cr-events>${text}</cr-events>
+ <dialog>${text}</dialog>
+ <iron-icon>${text}</iron-icon>
+ <iron-list>${text}</iron-list>
+ <paper-icon-button>${text}</paper-icon-button>
+ <paper-ripple>${text}</paper-ripple>
+ <paper-slider>${text}</paper-slider>
+ <paper-spinner>${text}</paper-spinner>
+ <style>${text}</style>
+ <template>${text}</template>
+ </settings-section>`;
+
+ var section = document.querySelector('settings-section');
+ assertTrue(section.hiddenBySearch);
+
+ return searchManager.search(text, section).then(function() {
+ assertTrue(section.hiddenBySearch);
+ });
+ });
+
// 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() {

Powered by Google App Engine
This is Rietveld 408576698