Last Comment Bug 851443 - Create tests for richgrid binding
: Create tests for richgrid binding
Status: RESOLVED FIXED
:
Product: Firefox for Metro
Classification: Client Software
Component: Tests (show other bugs)
: Trunk
: x86_64 Windows 8.1
: -- normal (vote)
: Firefox 22
Assigned To: Sam Foster [:sfoster]
:
Mentors:
Depends on:
Blocks: 831918
  Show dependency treegraph
 
Reported: 2013-03-15 02:15 PDT by Sam Foster [:sfoster]
Modified: 2014-07-24 11:06 PDT (History)
2 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
New stubMethod helper and tests for most of the richgrid / richgriditem functionality (19.78 KB, patch)
2013-03-15 14:59 PDT, Sam Foster [:sfoster]
no flags Details | Diff | Review
New stubMethod helper and tests for most of the richgrid / richgriditem functionality (19.78 KB, patch)
2013-03-15 15:11 PDT, Sam Foster [:sfoster]
jmathies: review+
Details | Diff | Review

Description Sam Foster [:sfoster] 2013-03-15 02:15:24 PDT
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.
Comment 1 Sam Foster [:sfoster] 2013-03-15 14:59:40 PDT
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.
Comment 2 Sam Foster [:sfoster] 2013-03-15 15:11:10 PDT
Created attachment 725625 [details] [diff] [review]
New stubMethod helper and tests for most of the richgrid / richgriditem functionality
Comment 3 Sam Foster [:sfoster] 2013-03-15 15:16:25 PDT
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?
Comment 4 Jim Mathies [:jimm] 2013-03-15 15:41:05 PDT
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.
Comment 5 Sam Foster [:sfoster] 2013-03-15 15:56:01 PDT
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.
Comment 6 Sam Foster [:sfoster] 2013-03-18 09:45:48 PDT
I removed the try/catch around each test and pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/196693568165
Comment 7 Ryan VanderMeulen [:RyanVM] 2013-03-19 07:30:58 PDT
https://hg.mozilla.org/mozilla-central/rev/196693568165

Note You need to log in before you can comment on or make changes to this bug.