[GTTF] Make UI test framework less crashy by adding more NULL-checks.
[GTTF] Make UI test framework less crashy by adding more NULL-checks.

Also clean up the code a bit.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/782004

git-svn-id: http://src.chromium.org/svn/trunk/src@41261 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 26f2c5d2e4d4da8d9e408db836345aa3bb1cb4a1
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser