Create tests for richgrid binding

RESOLVED FIXED in Firefox 22

Status

Firefox for Metro
Tests
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: sfoster, Assigned: sfoster)

Tracking

Trunk
Firefox 22
x86_64
Windows 8.1
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
We rely on the richgrid and richgriditem bindings for all the tiles on the firefox start screen. The implementation of the various tile lists/grids is adding to and changing these bindings and what we expect of them. A set of chrome tests would help head off regressions and make explicit what the bindings are currently relied upon to do.
(Assignee)

Updated

4 years ago
Blocks: 831918
(Assignee)

Comment 1

4 years ago
Created attachment 725618 [details] [diff] [review]
New stubMethod helper and tests for most of the richgrid / richgriditem functionality

This covers most of the richgrid and richgriditem functionality actually in 
use - with the significant exception of arrangeItems which I've left as a todo. 

I found and fixed a couple of issues - mostly around the single/multiple modes and the meaning of select vs. selection. My hope is the tests will spell out what these things are known to do so we can quickly spot regressions and/or know what to change as the bindings continue to evolve.
 
I make use of a new stubMethod test helper for some of the tests, which is working out nicely. Seems like this might/ought to exist somewhere already though?  

The tests all pass for me - let me know if you spot any failures or bogus/misleading assertions.
Attachment #725618 - Flags: review?(mbrubeck)
(Assignee)

Updated

4 years ago
Assignee: nobody → sfoster
(Assignee)

Comment 2

4 years ago
Created attachment 725625 [details] [diff] [review]
New stubMethod helper and tests for most of the richgrid / richgriditem functionality
Attachment #725625 - Flags: review?(mbrubeck)
(Assignee)

Updated

4 years ago
Attachment #725618 - Attachment is obsolete: true
Attachment #725618 - Flags: review?(mbrubeck)
(Assignee)

Comment 3

4 years ago
Comment on attachment 725625 [details] [diff] [review]
New stubMethod helper and tests for most of the richgrid / richgriditem functionality

arrangeItems left as a todo. Also I've not covered the contextual actions stuff. Otherwise should be complete?
Attachment #725625 - Flags: review?(mbrubeck) → review?(jmathies)

Comment 4

4 years ago
Comment on attachment 725625 [details] [diff] [review]
New stubMethod helper and tests for most of the richgrid / richgriditem functionality

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

::: browser/metro/base/tests/browser_tiles.js
@@ +23,5 @@
> +
> +      is(grid.children.length, 1, "#grid1 has a single item");
> +      is(grid.children[0].control, grid, "#grid1 item's control points back at #grid1'");
> +    } catch(e) {
> +      info(this.desc + ": Caught exception: " + e.message);

Do we need this? I've added these myself and mbrubeck suggested I take them out such that unexpected exceptions cause failures. Ditto on all the others.
Attachment #725625 - Flags: review?(jmathies) → review+
(Assignee)

Comment 5

4 years ago
Maybe not. I find at least during test implementation that it helps a lot as you get a more useful stack trace. Also/besides, tests that rely on previous tests to to have run smell bad. Maybe I can just re-throw from the catch block.
(Assignee)

Comment 6

4 years ago
I removed the try/catch around each test and pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/196693568165
https://hg.mozilla.org/mozilla-central/rev/196693568165
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.