Closed
Bug 1109855
Opened 10 years ago
Closed 10 years ago
Some APZ gtests incorrectly cast AsyncPanZoomController* to TestAsyncPanZoomController*
Categories
(Core :: Panning and Zooming, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: kats, Assigned: kats)
References
Details
Attachments
(1 file)
6.21 KB,
patch
|
botond
:
review+
|
Details | Diff | Splinter Review |
Some gtests, such as HitTesting1, incorrectly cast a AsyncPanZoomController to a TestAsyncPanZoomController. This happens because UpdatePanZoomControllerTree is called which directly instantiates AsyncPanZoomController instances. The test code however assumes that pretty much all the APZCs in sight are TestAsyncPanZoomControllers, and the ApzcOf function does a cast which relies on this.
Comment 1•10 years ago
|
||
We could give APZCTreeManager a virtual CreateAPZC(...) function which creates a new AsyncPanZoomController, and override it in TestAPZCTreeManager to create TestAsyncPanZoomControllers.
Assignee | ||
Comment 2•10 years ago
|
||
Yes, I already have a patch for this (and the other bugs I'm filing). I just need bug numbers to put in commit messages.
Assignee | ||
Comment 3•10 years ago
|
||
I wanted to put the GestureBehaviour parameter on MakeAPZCInstance as well but it seemed to require #include'ing AsyncPanZoomController.h into APZCTreeManager.h which I didn't really want to do. Is there some way around that?
Attachment #8534609 -
Flags: review?(botond)
Comment 4•10 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3)
> Created attachment 8534609 [details] [diff] [review]
> Patch
>
> I wanted to put the GestureBehaviour parameter on MakeAPZCInstance as well
> but it seemed to require #include'ing AsyncPanZoomController.h into
> APZCTreeManager.h which I didn't really want to do. Is there some way around
> that?
I don't have a great solution, but a couple of ideas for the record:
1) Move GestureBehavior out into namespace scope and into a separate header
(or an existing header you're willing to include in APZCTreeManager.h).
2) Introduce an APZCFactory interface and have APZCTreeManager's constructor
take a pointer to that. The signature that includes GestureBehaviour then
goes into the definition of APZCFactory, which APZCTreeManager.h doesn't
need to see.
Comment 5•10 years ago
|
||
Comment on attachment 8534609 [details] [diff] [review]
Patch
Review of attachment 8534609 [details] [diff] [review]:
-----------------------------------------------------------------
I'm fine with doing this for now.
Attachment #8534609 -
Flags: review?(botond) → review+
Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #4)
> 1) Move GestureBehavior out into namespace scope and into a separate
> header
> (or an existing header you're willing to include in APZCTreeManager.h).
This would be my preferred alternative of the two, but for now I just left it as-is. Maybe later if we have more dependencies we can revisit it.
https://hg.mozilla.org/integration/mozilla-inbound/rev/149096da07e5
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•