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-on: https://chromium-review.googlesource.com/c/chromium/src/+/1516037
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639710}
7 files changed