Bug 99671 - Refactor picker tests to avoid flakiness and share code
Summary: Refactor picker tests to avoid flakiness and share code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keishi Hattori
URL:
Keywords:
Depends on:
Blocks: 92710
  Show dependency treegraph
 
Reported: 2012-10-17 19:01 PDT by Keishi Hattori
Modified: 2012-10-24 19:36 PDT (History)
3 users (show)

See Also:


Attachments
Patch (177.33 KB, patch)
2012-10-18 19:22 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (174.53 KB, patch)
2012-10-18 20:39 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (175.14 KB, patch)
2012-10-21 21:31 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.