<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
  <head>
    <title>Offline Application Cache - Event_updateready_swapCache</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
    <ol>
      <li>Modify the commented part in manifest file (manifest/clock.manifest) on the server.</li>
      <li>Refresh the page.</li>
    </ol>

    <div id="log"></div>

    <script>
      var t = async_test("swapCache method test after updateready event is raised");
      var cache = window.applicationCache;

      cache.onupdateready = t.step_func(function() {
        try {
          cache.swapCache();
          t.done();
        } catch (e) {
          assert_unreached("swapCache method failed.");
        }
      })
    </script>
  </body>
</html>
