Fixed flaky test snav-z-index.html.

requestAnimationFrame before initTest().

Without this change, repeat-each=10 caused failures most of the time.
With this change repeat-each=100 has been run locally a few times
without any failures (Linux x64).

Also converted some setTimeout => requestAnimationFrame for better
predictability.

R=kochi@chromium.org
BUG=724567

Change-Id: Ic1f27c3fda1ff7da063ab29286d707cb518ab7a6
Reviewed-on: https://chromium-review.googlesource.com/518163
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#475429}
4 files changed