Service Worker: Fix getRegistrations.html layout test.

Serialize the registration and unregistration sequence between top-level window
and its iframe so that the registration object in the iframe cannot be
derefenced before created.

Also this CL improves the performace of the registration purging operations at
the beginning of the test by using Promise.all(unreg_promises) instead of
serializing the promises. It should be noted that registration.unregister() 
promises resolve before the corresponding registrations are actually deleted 
from the storage as per spec: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#unregister-algorithm.
Thus this test made the registration purging step be waiting until the 
corresponding registrations are actually deleted from the storage.

BUG=502125

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

git-svn-id: svn://svn.chromium.org/blink/trunk@197899 bbb929c8-8fbe-4397-9dbb-9b2b20218538
4 files changed
tree: f33e78afed3e983e80e63cda5ba56db253632153
  1. third_party/