Closed Bug 1055040 Opened 10 years ago Closed 10 years ago

Intermittent test_bug470212.html | rangeCount should be 0 - got 1, expected 0

Categories

(Core :: DOM: Selection, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34
Tracking Status
firefox32 --- fixed
firefox33 --- fixed
firefox34 --- fixed
firefox-esr24 --- unaffected
firefox-esr31 --- fixed
b2g-v1.4 --- unaffected
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: RyanVM, Assigned: u459114)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 7 obsolete files)

This has been happening on trunk and b2g32 for about a week and a half now. Unfortunately, the builds have already been purged from pvtbuilds, so I can't retrigger tests from around then. However, it appears to have started after this merge from beta:
https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/pushloghtml?changeset=3ef04e578c09

If that's the case, bug 1043690 looks possible?

https://tbpl.mozilla.org/php/getParsedLog.php?id=46159051&tree=Mozilla-B2g32-v2.0

b2g_emulator_vm mozilla-b2g32_v2_0 opt test mochitest-9 on 2014-08-18 03:34:11 PDT for push 692c93509dc9
slave: tst-linux64-spot-633

03:46:29     INFO -  418 INFO TEST-START | /tests/layout/generic/test/test_bug470212.html
03:46:30     INFO -  419 INFO TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_bug470212.html | rangeCount should be 0 - got 1, expected 0
03:46:31     INFO -  420 INFO TEST-INFO | MEMORY STAT vsize after test: 134275072
03:46:31     INFO -  421 INFO TEST-INFO | MEMORY STAT residentFast after test: 55201792
03:46:31     INFO -  422 INFO TEST-INFO | MEMORY STAT heapAllocated after test: 50700108
03:46:31     INFO -  423 INFO TEST-END | /tests/layout/generic/test/test_bug470212.html | finished in 1524ms
Managed to get a run on an older push and this appears to be older than bug 1043690.
Morris, is this relative to text selection?

BTW, basically, I don't know why we skip this test on b2g::debug while enable it on b2g::release 

skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(shift mouse select not working in b2g) b2g-desktop(shift mouse select not working in b2g)

If we read this comment, we should skip this test case on both debug and release version.
Flags: needinfo?(mtseng)
Blocks: B2GRT
This reproduces on b2g32 as far back as July 31. No idea what's going on here.
There are two relative issues
1. bug 470212
   This test case is landed in this bug.
2. bug 988334
   Change SpecialPower-window relation from 1-to-n to 1-to-1, and modify this test accordingly.

If we go back to bug 470212, the scenario of this test case should be
  Hold down Shift, click and drag on one of the Canvas.

wu.sendMouseEvent('mousedown', 0, 50, 0, 1, 4);   << mousedown position should be exactly on canvas
wu.sendMouseEvent('mousemove', 70, 70, 0, 0, 4);
wu.sendMouseEvent('mousemove', 80, 500, 0, 0, 4);
is(window.getSelection().rangeCount, 0, "rangeCount should be 0");

By default CSS change, this test case might become invalid. For example, if we change margin of body, in default CSS, to 100, then (0, 50) is located on the <body> instead of <canvas>, we probably will select <a> element
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=470212">Mozilla Bug 470212</a>

Then, window.getSelection().rangeCount change to 1 and test case fail.

I think we should change the position of mousedown event by 
<canvas style="border: 1px solid black;" id="dragTarget">

var target=document.getElementById("dragTarget");
var cavasRect=target[0].getBoundingClientRect();
wu.sendMouseEvent('mousedown', cavasRect.x + 1, cavasRect.y, 0, 1, 4);
Assignee: nobody → cku
Attached patch WIP (obsolete) — Splinter Review
Attachment #8474974 - Attachment is obsolete: true
Attachment #8474975 - Attachment is obsolete: true
update comment in patch
Attachment #8474976 - Attachment is obsolete: true
Flags: needinfo?(mtseng)
Attachment #8474980 - Attachment is obsolete: true
Comment on attachment 8475036 [details] [diff] [review]
Sent mouse events according to target's coordinate and enable this test case on B2G

Review of attachment 8475036 [details] [diff] [review]:
-----------------------------------------------------------------

Hi ehsan,
Could you help to review this patch?
Attachment #8475036 - Flags: review?(ehsan)
I did two things in this patch
1. Enable this test case on both B2G::debug and B2G::release
   We may either enable it on both debug and release build, or disable on both builds. It's not really make sense to enable only on one of these build.

2. Evaluate canvas position on the fly by using getClientBoundingRect, instead of assume where canvas is at coding time.
   default css of xul/ iframe/ body on different platforms is not still, it may change. Assume position of an element stay at specific place is not robust, many things break this assumption, such as viewport change/ default CSS change.
Comment on attachment 8475036 [details] [diff] [review]
Sent mouse events according to target's coordinate and enable this test case on B2G

Review of attachment 8475036 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!
Attachment #8475036 - Flags: review?(ehsan) → review+
Carry r+ and refurbish inline comment
Attachment #8475036 - Attachment is obsolete: true
Attachment #8475635 - Flags: review+
Keywords: checkin-needed
Blocks: 974242
Thanks for the quick fix!
https://hg.mozilla.org/integration/b2g-inbound/rev/8d72d8f5f247
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8d72d8f5f247
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: