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

Side by Side Diff: LayoutTests/fast/forms/resources/picker-common.js

Issue 536903002: AX: Make the calendar role "grid". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: /_/g and timezone-independecy Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 window.jsTestIsAsync = true; 1 window.jsTestIsAsync = true;
2 if (window.internals) 2 if (window.internals)
3 internals.setEnableMockPagePopup(true); 3 internals.setEnableMockPagePopup(true);
4 4
5 var popupWindow = null; 5 var popupWindow = null;
6 6
7 var popupOpenCallback = null; 7 var popupOpenCallback = null;
8 function openPicker(input, callback) { 8 function openPicker(input, callback) {
9 input.offsetTop; // Force to lay out 9 input.offsetTop; // Force to lay out
10 if (input.type === "color") { 10 if (input.type === "color") {
11 input.focus(); 11 input.focus();
12 eventSender.keyDown(" "); 12 eventSender.keyDown(" ");
13 } else { 13 } else {
14 sendKey(input, "Down", false, true); 14 sendKey(input, "Down", false, true);
15 } 15 }
16 popupWindow = document.getElementById('mock-page-popup').contentWindow; 16 popupWindow = document.getElementById('mock-page-popup').contentWindow;
17 if (typeof callback === "function") { 17 if (typeof callback === "function") {
18 popupOpenCallback = callback; 18 popupOpenCallback = callback;
19 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false); 19 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false);
20 } 20 }
21 } 21 }
22 22
23 function popupOpenCallbackWrapper() { 23 function popupOpenCallbackWrapper() {
24 popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper); 24 popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper);
25 popupOpenCallback(); 25 setTimeout(popupOpenCallback, 0);
26 } 26 }
27 27
28 function waitUntilClosing(callback) { 28 function waitUntilClosing(callback) {
29 setTimeout(callback, 1); 29 setTimeout(callback, 1);
30 } 30 }
31 31
32 function sendKey(input, keyName, ctrlKey, altKey) { 32 function sendKey(input, keyName, ctrlKey, altKey) {
33 var event = document.createEvent('KeyboardEvent'); 33 var event = document.createEvent('KeyboardEvent');
34 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName , 0, ctrlKey, altKey); 34 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName , 0, ctrlKey, altKey);
35 input.dispatchEvent(event); 35 input.dispatchEvent(event);
36 } 36 }
37 37
38 38
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/calendar-picker/date-picker-ax-expected.txt ('k') | Source/web/resources/calendarPicker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698