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

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

Issue 765903002: Remove internals.setEnableMockPagePopup(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 window.jsTestIsAsync = true; 1 window.jsTestIsAsync = true;
2 2
3 var popupWindow = null; 3 var popupWindow = null;
4 4
5 var popupOpenCallback = null; 5 var popupOpenCallback = null;
6 6
7 function openPickerWithMock(input, callback) {
8 if (window.internals)
9 internals.setEnableMockPagePopup(true);
10 input.offsetTop; // Force to lay out
11 if (input.type === "color") {
12 input.focus();
13 eventSender.keyDown(" ");
14 } else {
15 sendKey(input, "Down", false, true);
16 }
17 popupWindow = document.getElementById('mock-page-popup').contentWindow;
18 if (typeof callback === "function") {
19 popupOpenCallback = callback;
20 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false);
21 }
22 }
23
24 function popupOpenCallbackWrapper() { 7 function popupOpenCallbackWrapper() {
25 popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper); 8 popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper);
26 setTimeout(popupOpenCallback, 0); 9 setTimeout(popupOpenCallback, 0);
27 } 10 }
28 11
29 function waitUntilClosing(callback) { 12 function waitUntilClosing(callback) {
30 setTimeout(callback, 1); 13 setTimeout(callback, 1);
31 } 14 }
32 15
33 function sendKey(input, keyName, ctrlKey, altKey) { 16 function sendKey(input, keyName, ctrlKey, altKey) {
(...skipping 16 matching lines...) Expand all
50 popupOpenCallback = (function(callback) { 33 popupOpenCallback = (function(callback) {
51 // We need to move the window to the top left of available space 34 // We need to move the window to the top left of available space
52 // because the window will move back to (0, 0) when the 35 // because the window will move back to (0, 0) when the
53 // ShellViewMsg_SetTestConfiguration IPC arrives. 36 // ShellViewMsg_SetTestConfiguration IPC arrives.
54 window.moveTo(); 37 window.moveTo();
55 callback(); 38 callback();
56 }).bind(this, callback); 39 }).bind(this, callback);
57 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false); 40 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false);
58 } 41 }
59 } 42 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698