Open Bug 900969 Opened 11 years ago Updated 2 years ago

Failing deviceorientation test_bug615597.html for b2g mochitest

Categories

(Core :: DOM: Device Interfaces, defect, P5)

x86
macOS
defect

Tracking

()

REOPENED
mozilla26

People

(Reporter: martijn.martijn, Unassigned)

Details

Attachments

(1 file, 3 obsolete files)

Attached patch 615597.diff (obsolete) — Splinter Review
The attached patch makes this test pass against my local b2g emulator mochitest run, while it would previously fail with these errors:
0 INFO SimpleTest START
1 INFO TEST-START | /tests/content/events/test/test_bug615597.html
2 INFO TEST-PASS | /tests/content/events/test/test_bug615597.html | Should have seen DeviceOrientationEvent!
3 INFO TEST-PASS | /tests/content/events/test/test_bug615597.html | undefined
4 INFO TEST-PASS | /tests/content/events/test/test_bug615597.html | undefined
5 INFO TEST-PASS | /tests/content/events/test/test_bug615597.html | undefined
6 INFO TEST-PASS | /tests/content/events/test/test_bug615597.html | undefined
7 INFO TEST-END | /tests/content/events/test/test_bug615597.html | finished in 1472ms
8 ERROR TEST-UNEXPECTED-FAIL | /tests/content/events/test/test_bug615597.html | undefined - got 0, expected 1.5
9 ERROR TEST-UNEXPECTED-FAIL | /tests/content/events/test/test_bug615597.html | undefined - got -90, expected 2.25
10 ERROR TEST-UNEXPECTED-FAIL | /tests/content/events/test/test_bug615597.html | undefined - got 0, expected 3.667
11 INFO TEST-PASS | /tests/content/events/test/test_bug615597.html | undefined
12 ERROR TEST-UNEXPECTED-FAIL | /tests/content/events/test/test_bug615597.html | [SimpleTest.finish()] this test already called finish!
13 ERROR TEST-UNEXPECTED-FAIL | /tests/content/events/test/test_bug615597.html | called finish() multiple times
Attachment #785002 - Flags: review?(azakai)
Comment on attachment 785002 [details] [diff] [review]
615597.diff

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

I haven't worked on this for years, so I am probably not the right person to review it I am afraid.

One comment though, adding a setTimeout of 0 was frowned upon last I heard, because it can cause intermittent failures. But again, my information could be out of date.
Attachment #785002 - Flags: review?(azakai)
Attachment #785002 - Flags: review?(bugs)
setTimeout is no worse than executeSoon.
Comment on attachment 785002 [details] [diff] [review]
615597.diff

But this shouldn't fail without timeout.
Attachment #785002 - Flags: review?(bugs) → review-
Ok, but isn't there a potential problem here?
waitForExplicitFinish called after the event being invoked, which means that Simpletest.finish can be called before Simpletest.waitForExplicitFinish?

There are also these tests, which look very similar to this test (they were based on this test):
http://mxr.mozilla.org/mozilla-central/source/content/events/test/test_bug667919-1.html?force=1
http://mxr.mozilla.org/mozilla-central/source/content/events/test/test_bug667919-2.html?force=1

test_bug667919-1.html and test_bug667919-2.html are actually the same, I think that one of those 2 tests was meant to use devicemotion instead.
Summary: Fix content/events/test/test_bug615597.html for b2g mochitest → Failing deviceorientation test_bug615597.html for b2g mochitest
Comment on attachment 785002 [details] [diff] [review]
615597.diff

Oh, I missed that. Wouldn't this pass if you just
remove SimpleTest.waitForExplicitFinish() and SimpleTest.finish();
Then wouldn't there be a risk that the deviceorientation event is received after the load event has been fired (which means in mochitest terms that the test is finished, when to waitForExplicitFinish)?
Btw, I'm not sure that the patch that I attached (with or without that setTimeout call) would fix the failures in b2g, I seem to still get that error sometimes in b2g.

But probably still better to fix this test and those other tests I mentioned in comment 4 and change test_bug667919-2.html to use devicemotion.
(In reply to Martijn Wargers [:mw22] (QA - IRC nick: mw22) from comment #7)
> Then wouldn't there be a risk that the deviceorientation event is received
> after the load event has been fired (which means in mochitest terms that the
> test is finished, when to waitForExplicitFinish)?

But you dispatch the event manually, and dispatchEvent is synchronous call.
Assignee: nobody → martijn.martijn
Attached patch 900969.diff (obsolete) — Splinter Review
Pushed this to try: https://tbpl.mozilla.org/?tree=Try&rev=823464c5a331
Attachment #785002 - Attachment is obsolete: true
Attached patch 900969.diff (obsolete) — Splinter Review
The failures are still happening in b2g, so this improvement didn't help for the failures.

I got the impression, I didn't get the failures on b2g when the tests would be carried out after page load, for some reason.
Attachment #788723 - Attachment is obsolete: true
Attachment #788736 - Flags: review?(bugs)
What, we have the same test twice?
Attachment #788736 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #12)
> What, we have the same test twice?

Yes, and there was already a test for devicemotion, so I didn't think there was a need to change it to a devicemotion test.

Please leave this bug open after this patch is checked in, the issue with this test not working on b2g is not resolved with this.
Attachment #788736 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a54cdafcd916
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Thanks for the check-in, but this is not fixed for b2g yet.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
You should have added [leave open] to the whiteboard. Otherwise the merge script will change the status automatically.
Thanks for the info Masatoshi (I just saw jgriffin doing it, so I was just made aware of it).
Assignee: martijn.martijn → nobody
Status: REOPENED → RESOLVED
Closed: 11 years ago7 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Priority: -- → P5
Component: DOM: Events → DOM: Device Interfaces
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: