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

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

Issue 530653002: Use page popup pixel readback for calendar-picker-appearance.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline test 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/resources/picker-common.js
diff --git a/LayoutTests/fast/forms/resources/picker-common.js b/LayoutTests/fast/forms/resources/picker-common.js
index 85be4f715414d6ad52bc7a26abf3acccecb8d496..4956b74947dd718e40b97778fd10fd28473985fb 100644
--- a/LayoutTests/fast/forms/resources/picker-common.js
+++ b/LayoutTests/fast/forms/resources/picker-common.js
@@ -1,11 +1,11 @@
window.jsTestIsAsync = true;
-if (window.internals)
- internals.setEnableMockPagePopup(true);
var popupWindow = null;
var popupOpenCallback = null;
function openPicker(input, callback) {
+ if (window.internals)
+ internals.setEnableMockPagePopup(true);
input.offsetTop; // Force to lay out
if (input.type === "color") {
input.focus();
@@ -35,4 +35,24 @@ function sendKey(input, keyName, ctrlKey, altKey) {
input.dispatchEvent(event);
}
-
+function openPickerWithoutMock(input, callback) {
+ window.moveTo();
+ input.offsetTop; // Force to lay out
+ if (input.type === "color") {
+ input.focus();
+ eventSender.keyDown(" ");
+ } else {
+ sendKey(input, "Down", false, true);
+ }
+ popupWindow = window.internals.pagePopupWindow;
+ if (typeof callback === "function") {
+ popupOpenCallback = (function(callback) {
+ // We need to move the window to the top left of available space
+ // because the window will move back to (0, 0) when the
+ // ShellViewMsg_SetTestConfiguration IPC arrives.
+ window.moveTo();
+ callback();
+ }).bind(this, callback);
+ popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false);
+ }
+}
« no previous file with comments | « LayoutTests/fast/forms/calendar-picker/calendar-picker-appearance.html ('k') | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698