Firefox bug 702161 – part II
In my last post I described the work I have been doing on Firefox bug 702161. I got ( what I think ) is a fix and I was ready to write some tests. Personally I hate writing tests, as I’m sure everyone does, but they are essential ( especially in an open source project where many people are touching the code ). The unit tests that I had to write this time weren’t so much annoying as most that I write are, but more just hard to figure out a good way to write tests for. I have had a few ideas over the past 2 days how to test what I wrote and nothing seems to be easy or viable.
Another idea that I had, tho not as good as the above one, was to use some of the EventUtils tests that Firefox has to offer. The one in particular that caught my eye was synthesizeMouseExpectEvent. From what I understood about this test method was that I could go to a x,y location, synthesize a click, and check to see if any events resulted from that click ( or mouse movement ). It would be perfect if I could do this because I can check to see if there is an event thrown initially, then somehow call the terminate method ( still haven’t figured that out either ), and check to make sure that no event is thrown the second time. The problem I ran into here was that I couldn’t get the test method to work properly with the video controls, which leads me to believe that what I want to do isn’t possible with this either. I set up a dummy test case with a button and on click listener and the test method worked fine. As soon as I tried a similar approach on the controls it didn’t work. What I’m guessing is the issue here is that the event that is being fired is being stopped from bubbling up to a point where I can catch it. I am going to have to do a bit of searching tomorrow on this theory and see if my assumption is correct.
Other than this I am pretty much at a standstill with this bug. I have thrown what I have done up for an initial look over and hope to get some good feedback. In the meantime I am going to take a break from this bug and start on one of my others in the meantime. I’ve got a few other cool ones, so I don’t feel bad about taking a break from this for a day or so :)