Bug 99671

Summary: Refactor picker tests to avoid flakiness and share code
Product: WebKit Reporter: Keishi Hattori <keishi>
Component: FormsAssignee: Keishi Hattori <keishi>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 92710    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Keishi Hattori 2012-10-17 19:01:50 PDT
Refactor picker tests to avoid flakiness and share code
Comment 1 Keishi Hattori 2012-10-18 19:22:16 PDT
Created attachment 169535 [details]
Patch
Comment 2 Kent Tamura 2012-10-18 19:31:39 PDT
Comment on attachment 169535 [details]
Patch

Please rebase.
Comment 3 Keishi Hattori 2012-10-18 20:39:16 PDT
Created attachment 169540 [details]
Patch
Comment 4 WebKit Review Bot 2012-10-18 21:28:17 PDT
Comment on attachment 169540 [details]
Patch

Attachment 169540 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14455367

New failing tests:
platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-reset-value-after-reload.html
platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-key-operations.html
Comment 5 Kent Tamura 2012-10-18 21:30:15 PDT
Comment on attachment 169540 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169540&action=review

> LayoutTests/platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-step.html:22
> +openPicker(document.getElementById('date'), finishTest);
> +
>  function finishTest() {
> -    popupWindow.removeEventListener('resize', finishTest);
> -    setTimeout(function() { testRunner.notifyDone(); }, 0);
> +    finishJSTest();

We can remove finishTest by openPicker(document...., finishJSTest);

> LayoutTests/platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance.html:22
> +openPicker(document.getElementById('date'), finishTest);
> +
>  function finishTest() {
> -    console.log(popupWindow.pagePopupController);
> -    popupWindow.removeEventListener('resize', finishTest);
> -    setTimeout(function() {testRunner.notifyDone();}, 0);
> +    finishJSTest();
>  }

ditto.

> LayoutTests/platform/chromium/fast/forms/color/color-suggestion-picker-one-row-appearance.html:24
> +openPicker(document.getElementById('color'), test);
>  
> -document.getElementById('color').focus();
> -if (window.eventSender)
> -    eventSender.keyDown(' ');
> -var pickerWindow = document.getElementById('mock-page-popup').contentWindow;
> -pickerWindow.onresize = function() {
> -    testRunner.notifyDone();
> +function test() {
> +    finishJSTest();
>  }

ditto.

> LayoutTests/platform/chromium/fast/forms/color/color-suggestion-picker-two-row-appearance.html:30
> +openPicker(document.getElementById('color'), test);
>  
> -document.getElementById('color').focus();
> -if (window.eventSender)
> -    eventSender.keyDown(' ');
> -var pickerWindow = document.getElementById('mock-page-popup').contentWindow;
> -pickerWindow.onresize = function() {
> -    testRunner.notifyDone();
> +function test() {
> +    finishJSTest();
>  }

ditto.

> LayoutTests/platform/chromium/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance.html:59
> +openPicker(document.getElementById('color'), test);
>  
> -document.getElementById('color').focus();
> -if (window.eventSender)
> -    eventSender.keyDown(' ');
> -var pickerWindow = document.getElementById('mock-page-popup').contentWindow;
> -pickerWindow.onresize = function() {
> -    testRunner.notifyDone();
> +function test() {
> +    finishJSTest();
>  }

ditto.

> LayoutTests/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl.html:44
> +<script>
> +openPicker(document.getElementById('date'), finishTest);
>  
>  function finishTest() {
> -    popupWindow.removeEventListener('resize', finishTest);
> -    setTimeout(function() { testRunner.notifyDone(); }, 0);
> +    finishJSTest();
>  }

ditto.

> LayoutTests/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance.html:48
> +openPicker(document.getElementById('date'), finishTest);
> +
>  function finishTest() {
> -    popupWindow.removeEventListener('resize', finishTest);
>      popupWindow.focus();
>      eventSender.keyDown('downArrow');
> -    setTimeout(function() {testRunner.notifyDone();}, 0);
> +    finishJSTest();
>  }

ditto.
Comment 6 Keishi Hattori 2012-10-21 21:31:14 PDT
Created attachment 169828 [details]
Patch
Comment 7 Kent Tamura 2012-10-21 21:54:13 PDT
Comment on attachment 169828 [details]
Patch

looks good
Comment 8 WebKit Review Bot 2012-10-21 22:08:31 PDT
Comment on attachment 169828 [details]
Patch

Clearing flags on attachment: 169828

Committed r132028: <http://trac.webkit.org/changeset/132028>
Comment 9 WebKit Review Bot 2012-10-21 22:08:36 PDT
All reviewed patches have been landed.  Closing bug.