[HTML Imports] Employ load/error events to stabilize polling-based tests.

Now HTML Imports suppors load end error events, even inside the imported document.
Let's use it to make tests less flaky.

BUG=240592
R=dominicc,dglazkov

Review URL: https://chromiumcodereview.appspot.com/23903029

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