Closed Bug 539955 Opened 15 years ago Closed 15 years ago

[OOPP] unit test failure in test_plugin_mouse_coords.html

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Windows 7
defect
Not set
normal

Tracking

(status1.9.2 .4-fixed)

RESOLVED FIXED
Tracking Status
status1.9.2 --- .4-fixed

People

(Reporter: benjamin, Assigned: jimm)

References

Details

(Whiteboard: [fixed-lorentz])

Attachments

(2 files, 1 obsolete file)

With OOPP on:
64634 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p1 mouse down X - got 328, expected 15
64635 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p1 mouse down Y - got 236, expected 18
64636 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p1 mouse move X - got 328, expected 15
64637 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p1 mouse move Y - got 256, expected 38
64638 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p1 mouse up X - got 328, expected 15
64639 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p1 mouse up Y - got 246, expected 28
64640 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p2 mouse down X - got 38, expected 15
64641 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p2 mouse down Y - got 486, expected 18
64642 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p2 mouse move X - got 38, expected 15
64643 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p2 mouse move Y - got 506, expected 38
64644 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p2 mouse up X - got 38, expected 15
64645 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p2 mouse up Y - got 496, expected 28
64646 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p3 mouse down X - got 348, expected 6
64647 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p3 mouse down Y - got 476, expected 11
64648 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p3 mouse move X - got 348, expected 6
64649 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p3 mouse move Y - got 496, expected 31
64650 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p3 mouse up X - got 348, expected 6
64651 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_mouse_coords.html | p3 mouse up Y - got 486, expected 21
Depends on: 538918
Sorry, originally thought these failures were related to some work I'm doing in bug 538918, but they aren't!
No longer depends on: 538918
Ok, so couple things here - first, these controls in this test are all *windowless*, so the these tests fail to run windowed controls. I'll file a separate, non-oopp bug on that. Second, the code that calculates the mouse position in the test plugin makes some assumptions that are incompatible with oopp - 

mouse events:

int x = instanceData->hasWidget ? 0 : instanceData->window.x;
int y = instanceData->hasWidget ? 0 : instanceData->window.y;
instanceData->lastMouseX = GET_X_LPARAM(pe->lParam) - x;
instanceData->lastMouseY = GET_Y_LPARAM(pe->lParam) - y;

debug code:
printf("plugin: %d x %d (%d x %d)\n", GET_X_LPARAM(pe->lParam), GET_Y_LPARAM(pe->lParam), instanceData->lastMouseX, instanceData->lastMouseY);

Typical mouse movement data for a control located at offset 300 x 0:

non-oopp:
plugin: 305 x 10 (5 x 0)
plugin: 305 x 10 (5 x 0)
plugin: 305 x 11 (5 x 1)
plugin: 304 x 11 (4 x 1)
..

oopp:
plugin: 300 x 10 (300 x 10)
plugin: 300 x 10 (300 x 10)
plugin: 301 x 11 (301 x 11)
plugin: 302 x 12 (302 x 12)
..

instanceData->window.x/y come from the NPP_SetWindow call, and normally represent the controls position in the parent (browser) window. But with windowless oopp, we render to an offscreen dib with an origin at 0,0. NPP_SetWindow is used to setup drawing so the oopp origin is correct. The logic in the test plugin for cursor position doesn't expect this however. I'll see if I can touch this up somehow to get it working regardless.
Attached patch make testplugin work with oopp (obsolete) — Splinter Review
nsObjectFrame comments indicate origin data comes from WM_WINDOWPOSCHANGED, so this should be result in correct position info regardless of oopp. (pushed e10s and m-c builds to try for some test runs to make sure.)
Attachment #421872 - Attachment is obsolete: true
Attachment #421907 - Flags: review?(benjamin)
bah, I'll pull the printfs out in the final.
Attached patch finalSplinter Review
Comment on attachment 421907 [details] [diff] [review]
rev2 w/test set timeout change

Remove the extraneous printfs before checkin.
Attachment #421907 - Flags: review?(benjamin) → review+
http://hg.mozilla.org/mozilla-central/rev/f21c1add12f3
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blanket approval for Lorentz merge to mozilla-1.9.2
a=beltzner for 1.9.2.4 - please make sure to mark status1.9.2:.4-fixed
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: