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

Unified Diff: chrome/test/data/pdf/basic_test_material.js

Issue 1162863002: Material PDF: Fix inconsistent behaviour in page selector, update styling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test for shouldIgnoreKeyEvents Created 5 years, 7 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/pdf/basic_test_material.js
diff --git a/chrome/test/data/pdf/basic_test_material.js b/chrome/test/data/pdf/basic_test_material.js
index 33d617603f17257396eb31761085ad4a7ae04b29..cd713b6b372ee6cc45797b889b7cf2b6ae099d50 100644
--- a/chrome/test/data/pdf/basic_test_material.js
+++ b/chrome/test/data/pdf/basic_test_material.js
@@ -36,6 +36,21 @@ var tests = [
plugin.getAttribute('src').indexOf('/pdf/test.pdf') != -1);
chrome.test.succeed();
},
+
+ /**
+ * Test that shouldIgnoreKeyEvents correctly searches through the shadow DOM
+ * to find input fields.
+ */
+ function testIgnoreKeyEvents() {
+ document.getElementById('material-toolbar').$.pageselector.$.input.focus();
+ // Tests that the traversal through the shadow DOM works correctly.
+ chrome.test.assertTrue(
+ shouldIgnoreKeyEvents(document.getElementById('material-toolbar')));
+ chrome.test.assertFalse(
+ shouldIgnoreKeyEvents(document.getElementById('plugin')));
+
+ chrome.test.succeed();
+ }
];
chrome.test.runTests(tests);

Powered by Google App Engine
This is Rietveld 408576698