Open Bug 504313 Opened 15 years ago Updated 2 years ago

intermittent failure at test_cursorsnap.xhtml,test_cursorsnap.xul

Categories

(Core :: Widget: Win32, defect, P3)

x86
Windows Vista
defect

Tracking

()

People

(Reporter: masayuki, Unassigned)

References

Details

(Keywords: intermittent-failure, Whiteboard: [test temporarily disabled][tpi:-])

test_cursorsnap.xul was succeeded on my machine and tryserver but it's failed on tinderbox machine.

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1247652050.1247661958.11585.gz
> 6857 INFO Running chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul...
> 6858 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6859 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6860 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6861 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6862 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6863 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | cursor is NOT snapped to the default button (dialog)
> 6864 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | cursor is NOT snapped to the disabled button (dialog)
> 6865 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | cursor is NOT snapped to the hidden button (dialog)
> 6866 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6867 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6868 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6869 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6870 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | retry the current test...
> 6871 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | cursor is NOT snapped to the default button (wizard)
> 6872 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | cursor is NOT snapped to the disabled button (wizard)
> 6873 INFO TEST-PASS | chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_cursorsnap.xul | cursor is NOT snapped to the hidden button (wizard)

This log means that the cursor isn't snapped every time. There is a possibility.

> nsWindow::OnDefaultButtonLoaded(const nsIntRect &aButtonRect)
> {
> #ifdef WINCE
>   return NS_ERROR_NOT_IMPLEMENTED;
> #else
>   if (aButtonRect.IsEmpty())
>     return NS_OK;
> 
>   // Don't snap when we are not active.
>   HWND activeWnd = ::GetActiveWindow();
>   if (activeWnd != ::GetForegroundWindow() ||
>       GetTopLevelHWND(mWnd, PR_TRUE) != GetTopLevelHWND(activeWnd, PR_TRUE)) {
>     return NS_OK;
>   }
> 
>   PRBool isAlwaysSnapCursor = PR_FALSE;
>   nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
>   if (prefs) {
>     nsCOMPtr<nsIPrefBranch> prefBranch;
>     prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
>     if (prefBranch) {
>       prefBranch->GetBoolPref("ui.cursor_snapping.always_enabled",
>                               &isAlwaysSnapCursor);
>     }
>   }
> 
>   if (!isAlwaysSnapCursor) {
>     BOOL snapDefaultButton;
>     if (!::SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0,
>                                 &snapDefaultButton, 0) || !snapDefaultButton)
>       return NS_OK;
>   }
> 
>   nsIntRect widgetRect;
>   nsresult rv = GetScreenBounds(widgetRect);
>   NS_ENSURE_SUCCESS(rv, rv);
>   nsIntRect buttonRect(aButtonRect + widgetRect.TopLeft());
> 
>   nsIntPoint centerOfButton(buttonRect.x + buttonRect.width / 2,
>                             buttonRect.y + buttonRect.height / 2);
>   // The center of the button can be outside of the widget.
>   // E.g., it could be hidden by scrolling.
>   if (!widgetRect.Contains(centerOfButton)) {
>     return NS_OK;
>   }
> 
>   if (!::SetCursorPos(centerOfButton.x, centerOfButton.y)) {
>     NS_ERROR("SetCursorPos failed");
>     return NS_ERROR_FAILURE;
>   }
>   return NS_OK;
> #endif
> }

If the Fx isn't active or Fx's another window is active, the SetCursorPos isn't called. But in such case, some other tests should be failed.
Blocks: 76053
No longer blocks: 46053
Whiteboard: [orange]
Ugh... the tests passed at the later cycles. I temporally disabled the new tests, but should I enable it even if I cannot find the cause of this failure?
Whiteboard: [orange] → [orange] temporally, the test is disabled in the makefile
Summary: test_cursorsnap.xul failed on tinerbox machine → intermittent failure at test_cursorsnap.xul
Blocks: 438871
Whiteboard: [orange] temporally, the test is disabled in the makefile → [orange][test temporarily disabled]
Whiteboard: [orange][test temporarily disabled] → [test temporarily disabled]
Bulk assigning P3 to all open intermittent bugs without a priority set in Firefox components per bug 1298978.
Priority: -- → P3
Whiteboard: [test temporarily disabled] → [test temporarily disabled][tpi:-]
Summary: intermittent failure at test_cursorsnap.xul → intermittent failure at test_cursorsnap.xhtml,test_cursorsnap.xul
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.