[ash] Cleanup ShelfViewTest

Follow the convention of gtest.
Make Duplicated codes as a function.

R=jamescook@chromium.org
BUG=NONE
TEST=ash_unittests --gtest_filter=ShelfView*.*

Review URL: https://codereview.chromium.org/105813009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241426 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 241426