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

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: Fix rebase mistake 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
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..97cb1d533af73bc41d00eb42d13f3b6c2a515226 100644
--- a/chrome/test/data/pdf/basic_test_material.js
+++ b/chrome/test/data/pdf/basic_test_material.js
@@ -36,6 +36,29 @@ 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() {
+ // Test that the traversal through the shadow DOM works correctly.
+ var toolbar = document.getElementById('material-toolbar');
+ toolbar.$.pageselector.$.input.focus();
+ chrome.test.assertTrue(shouldIgnoreKeyEvents(toolbar));
+
+ // Test case where the active element has a shadow root of its own.
+ toolbar.$.buttons.children[0].focus();
+ chrome.test.assertFalse(shouldIgnoreKeyEvents(toolbar));
+
+ chrome.test.assertFalse(
+ shouldIgnoreKeyEvents(document.getElementById('plugin')));
+
+ chrome.test.succeed();
+ }
];
-chrome.test.runTests(tests);
+var scriptingAPI = new PDFScriptingAPI(window, window);
+scriptingAPI.setLoadCallback(function() {
+ chrome.test.runTests(tests);
+});
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698