Factor out test class for getting GitilesView from a path

The alternative of refactoring GitilesView itself to make parse(path)
just work is tempting, but it turns out that GitilesViewTest is
testing more than just GitilesView. Specifically, it's testing that
the various regexes in the MetaServlet actually end up getting parsed
into the right positions.

The implementation is a bit ugly of course but the ugliness is
confined to the GitilesViewTest class.

Change-Id: I9d390b97883ee73fb7291226fd1e5caa4bc1c714
3 files changed