Add timeouts to close-code-and-reason subtests

Layout test timeouts leave no information about what went wrong. By implementing timeouts within the tests, we can gather information about which part(s) fail. We can also reduce the time it takes to detect failure.

Also refactor the tests to use common code for the Worker and non-Worker
versions, and to use the Worker support built into js-test.js.

BUG=391068
TEST=close-code-and-reason.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@178169 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: speed up front-end startup via building more UI pieces early.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@178170 bbb929c8-8fbe-4397-9dbb-9b2b20218538