DevTools: Wait for external scripts to load in tests

The file run-after-layout-and-paint.js is used by a few tracing tests.
This file is written to the document as a script tag, but nothing was
waiting for the script tag's onload event. This made these tests
occasionally flake.

Change-Id: I5cf4e0d69d9bcabfab675e39e987cb0c576c5213
Reviewed-by: Dmitry Gozman <>
Commit-Queue: Joel Einbinder <>
Cr-Commit-Position: refs/heads/master@{#639710}
7 files changed