Closed Bug 856458 Opened 12 years ago Closed 12 years ago

Story - Fixup all failing mochitest-metro-chrome tests

Categories

(Firefox for Metro Graveyard :: Tests, defect, P2)

x86_64
Windows 8.1
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 23

People

(Reporter: jimm, Assigned: rsilveira)

References

Details

(Whiteboard: feature=story c=testing u=developer p=5)

Attachments

(1 file, 2 obsolete files)

Once we have these running, we'll need to fix up unreliable tests.
OS: Windows 7 → Windows 8 Metro
Whiteboard: feature=story c=testing u=developer p=0
Summary: Fixup all failing mochitest-metro-chrome tests → Story - Fixup all failing mochitest-metro-chrome tests
Assignee: nobody → rsilveira
Priority: -- → P2
QA Contact: jbecerra
Hey Asa, this requires a new story.
Status: NEW → ASSIGNED
Flags: needinfo?(asa)
Whiteboard: feature=story c=testing u=developer p=0 → feature=story c=testing u=developer p=5
Blocks: metrov1it5
No longer blocks: metrov1planning
WIP

Fixed some grid.xml bugs that were uncovered by browser_tiles test.

Fixed test hangs - When we reject a promise (say a waitForEvent timeout), taskjs throws an exception: https://mxr.mozilla.org/mozilla-central/source/toolkit/content/Task.jsm#193

Because we were not catching the exception, finish() was never called at runTests, hanging test execution until the test itself timed out. I've added a try/catch block to runTests to fix this.

The only non-intermittent failures I'm seeing with this patch are on download tests. Seems like a binding issue with XUL, I'm investigating.
Attachment #734739 - Attachment is obsolete: true
Attached patch Patch v1Splinter Review
There is a call to getBoundingClientRect() from richgrid's arrangeItems() that is triggering the richgrid-item constructor.
http://mxr.mozilla.org/mozilla-central/source/browser/metro/base/content/bindings/grid.xml?rev=e4b06af6ce99#343

But for some reason the bindings are not fully done and getAnonymousElementByAttribute() is returning null for the internal elements like anon-richgrid-item-icon. I've added a check for this case that will skip refresh() instead of throwing. 

Also fixed one last issue with download tests.

Now I get all test passing pretty frequently. The intermittent failures I get are timeouts, most on context menu test. We probably need something similar to what Jim is doing on Bug 859154 for those cases too, then I think we can consider enabling the tests in automation.
Attachment #735305 - Attachment is obsolete: true
Attachment #735534 - Flags: review?(mbrubeck)
Attachment #735534 - Flags: review?(jmathies)
Nice work. Yay for tests.
Comment on attachment 735534 [details] [diff] [review]
Patch v1

We also have bug 849015.
Attachment #735534 - Flags: review?(jmathies) → review+
Comment on attachment 735534 [details] [diff] [review]
Patch v1

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

Thanks!

::: browser/metro/base/content/bindings/grid.xml
@@ +56,3 @@
>                anItem.removeAttribute("selected");
>              } else {
>                anItem.setAttribute("selected", true);

You can now change this to "anItem.selected = !wasSelected;"

::: browser/metro/base/tests/mochitest/browser_onscreen_keyboard.js
@@ +44,5 @@
> +    let promise = waitForEvent(window, "MozDeckOffsetChanged");
> +    yield promise;
> +
> +    promise.then(function (event){
> +      is(event.detail, 100, "deck offset by keyboard height");

Wouldn't it be equivalent to write:

  let event = waitForEvent(window, "MozDeckOffsetChanged");
  is(event.detail, 100, "deck offset by keyboard height");

@@ -46,5 @@
>      MetroUtils.keyboardVisible = false;
>      Services.obs.notifyObservers(null, "metro_softkeyboard_hidden", null);
>  
> -    let rect2 = text.getBoundingClientRect();
> -    is(rect2.top, rect0.top, "text field moves back to the original position");

Is it possible to keep this assertion, after the final waitForEvent?
Attachment #735534 - Flags: review?(mbrubeck) → review+
(In reply to Matt Brubeck (:mbrubeck) from comment #7)
> Wouldn't it be equivalent to write:
> 
>   let event = waitForEvent(window, "MozDeckOffsetChanged");

Sorry, I meant:

  let event = yield waitForEvent(window, "MozDeckOffsetChanged");
(In reply to Jim Mathies [:jimm] from comment #6)
> We also have bug 849015.

Thanks! Strangely enough, I'm consistently seeing either all pass or the same 5 failures. 4 wait for popupshow and 1 timeout on browser_plugin_input_mouse. I'm curious as to why this connection is happening, might even be a product issue.

(In reply to Matt Brubeck (:mbrubeck) from comment #8)
> (In reply to Matt Brubeck (:mbrubeck) from comment #7)
> > Wouldn't it be equivalent to write:
> > 
> >   let event = waitForEvent(window, "MozDeckOffsetChanged");
> 
> Sorry, I meant:
> 
>   let event = yield waitForEvent(window, "MozDeckOffsetChanged");

Thanks for the review and for pointing this one out, much cleaner :). I've made the other updates too.
If the plugin tests get in the way, just disable them in the makefile. We worked on those back before adobe told us they weren't going to develop a flash plugin for metro.
https://hg.mozilla.org/mozilla-central/rev/855fe8cf74d8
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Story: As a Metro Developer, I can run mochitest-metro-chrome without failures because we've fixed them up ;-)
Flags: needinfo?(asa)
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: