<!DOCTYPE html>
<title>Service Worker: force-refresh registration test</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/test-helpers.js"></script>
<body>
<script>

async_test(function(t) {
    var scope = '/force-refresh-register';
    with_iframe('../resources/blank.html')
      .then(t.step_func(function(frame) {
          var p = new Promise(function(resolve) {
              // Override onload handler assigned by with_iframe. 
              frame.onload = t.step_func(function() {
                  resolve(frame.contentWindow.navigator.serviceWorker.register(
                      'worker-no-op.js',
                      {scope: scope}));
              });
          });
          frame.contentWindow.internals.forceReload(true);
          return p;
        }))
      .then(t.step_func(function() {
          service_worker_unregister_and_done(t, scope);
        }))
      .catch(unreached_rejection(t));
  }, 'Registering script from force-refreshed frame');

</script>

Add force-refreshed page registration layout test.
ServiceWorker: Add force-refreshed page registration layout test.

Add registration test for an iframe reloaded bypassing the cache.
The registration should succeed in this case.

BUG=392405

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@178920 bbb929c8-8fbe-4397-9dbb-9b2b20218538
