Bug 1199295 - Pass right loadingPrincipal to uriloader/prefetch - test updates (r=mayhemer)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Fri, 02 Oct 2015 09:16:45 -0700
changeset 299203 eb4a8da5c9645778a0dca4c4920c54b93c055348
parent 299202 8d76980d51998798b68cdf4f931b139c62ce2a06
child 299204 7c09ea35b37ef044c23f0094dd481deabb609cc7
push id5392
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:08:23 +0000
treeherdermozilla-beta@16ce8562a975 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1199295
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1199295 - Pass right loadingPrincipal to uriloader/prefetch - test updates (r=mayhemer)
dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html
dom/tests/mochitest/ajax/offline/test_updateCheck.html
netwerk/test/unit/test_bug767025.js
netwerk/test/unit/test_fallback_no-cache-entry_canceled.js
netwerk/test/unit/test_fallback_no-cache-entry_passing.js
netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js
netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js
netwerk/test/unit/test_fallback_request-error_canceled.js
netwerk/test/unit/test_fallback_request-error_passing.js
netwerk/test/unit/test_fallback_response-error_canceled.js
netwerk/test/unit/test_fallback_response-error_passing.js
netwerk/test/unit/test_offlinecache_custom-directory.js
netwerk/test/unit/test_pinned_app_cache.js
--- a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html
+++ b/dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html
@@ -24,16 +24,18 @@
 var updateService = SpecialPowers.Cc['@mozilla.org/offlinecacheupdate-service;1']
                                  .getService(Ci.nsIOfflineCacheUpdateService);
 
 var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
                        .getService(SpecialPowers.Ci.nsIObserverService);
 
 var errorReceived = false;
 
+var systemPrincipal = SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal();
+
 function finish() {
   obs.notifyObservers(updateService, "disk-space-watcher", "free");
 
   OfflineTest.teardownAndFinish();
 }
 
 if (OfflineTest.setup()) {
   obs.notifyObservers(updateService, "disk-space-watcher", "full");
@@ -68,17 +70,17 @@ if (OfflineTest.setup()) {
     applicationCacheAvailable: function() {}
   };
 
   var manifest = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest";
   var ioService = Cc["@mozilla.org/network/io-service;1"]
                   .getService(Ci.nsIIOService);
   var manifestURI = ioService.newURI(manifest, null, null);
   var documentURI = ioService.newURI(document.documentURI, null, null);
-  var update = updateService.scheduleUpdate(manifestURI, documentURI, window);
+  var update = updateService.scheduleUpdate(manifestURI, documentURI, systemPrincipal, window);
   update.addObserver(updateObserver, false);
 }
 
 SimpleTest.waitForExplicitFinish();
 
 </script>
 
 </head>
--- a/dom/tests/mochitest/ajax/offline/test_updateCheck.html
+++ b/dom/tests/mochitest/ajax/offline/test_updateCheck.html
@@ -24,34 +24,36 @@ SimpleTest.waitForExplicitFinish();
 
 var manifest = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs";
 var manifestURI = Cc["@mozilla.org/network/io-service;1"]
                   .getService(Ci.nsIIOService)
                   .newURI(manifest, null, null);
 var updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
                     .getService(Ci.nsIOfflineCacheUpdateService);
 
+var systemPrincipal = SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal();
+
 function manifestCached()
 {
   // Run first check for an update
-  updateService.checkForUpdate(manifestURI, 0, false, {
+  updateService.checkForUpdate(manifestURI, systemPrincipal, 0, false, {
     observe: function(subject, topic, data) {
       OfflineTest.is(topic, "offline-cache-update-unavailable", "No update avail");
 
       // Change the manifest content
       OfflineTest.setSJSState(manifest, "second");
 
       // Check we now get notification on update ready
-      updateService.checkForUpdate(manifestURI, 0, false, {
+      updateService.checkForUpdate(manifestURI, systemPrincipal, 0, false, {
         observe: function(subject, topic, data) {
           OfflineTest.is(topic, "offline-cache-update-available", "Update avail (1)");
 
           // Do the check again.  We must get the same result.  Double check is here
           // to make sure we don't overwrite any data in the cache by the check it self.
-          updateService.checkForUpdate(manifestURI, 0, false, {
+          updateService.checkForUpdate(manifestURI, systemPrincipal, 0, false, {
             observe: function(subject, topic, data) {
               OfflineTest.is(topic, "offline-cache-update-available", "Update avail (2)");
 
               // Update the manifest, invokes manifestUpdated()
               applicationCache.onupdateready = OfflineTest.priv(manifestUpdated);
               applicationCache.update();
             }
           });
@@ -59,17 +61,17 @@ function manifestCached()
       });
     }
   });
 }
 
 function manifestUpdated()
 {
   // Check for an update after manifest has been updated
-  updateService.checkForUpdate(manifestURI, 0, false, {
+  updateService.checkForUpdate(manifestURI, systemPrincipal, 0, false, {
     observe: function(subject, topic, data) {
       OfflineTest.is(topic, "offline-cache-update-unavailable", "No update avail (2)");
 
       OfflineTest.teardownAndFinish();
     }
   });
 }
 
--- a/netwerk/test/unit/test_bug767025.js
+++ b/netwerk/test/unit/test_bug767025.js
@@ -97,16 +97,17 @@ function do_app_cache(manifestURL, pageU
 
   Services.perms.add(manifestURL,
 		     "offline-app",
                      Ci.nsIPermissionManager.ALLOW_ACTION);
 
   let update =
     update_service.scheduleUpdate(manifestURL,
                                   pageURL,
+                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                   null); /* no window */
 
   return update;
 }
 
 function watch_update(update, stateChangeHandler, cacheAvailHandler) {
   let observer = {
     QueryInterface: function QueryInterface(iftype) {
--- a/netwerk/test/unit/test_fallback_no-cache-entry_canceled.js
+++ b/netwerk/test/unit/test_fallback_no-cache-entry_canceled.js
@@ -1,29 +1,30 @@
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://gre/modules/Services.jsm");
 
 var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -107,12 +108,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_no-cache-entry_passing.js
+++ b/netwerk/test/unit/test_fallback_no-cache-entry_passing.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -106,12 +107,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js
+++ b/netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -111,12 +112,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js
+++ b/netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -110,12 +111,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_request-error_canceled.js
+++ b/netwerk/test/unit/test_fallback_request-error_canceled.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -117,12 +118,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_request-error_passing.js
+++ b/netwerk/test/unit/test_fallback_request-error_passing.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -114,12 +115,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_response-error_canceled.js
+++ b/netwerk/test/unit/test_fallback_response-error_canceled.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/error/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -110,12 +111,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_fallback_response-error_passing.js
+++ b/netwerk/test/unit/test_fallback_response-error_passing.js
@@ -5,25 +5,26 @@ var httpServer = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/error/" + Math.random();
 
 XPCOMUtils.defineLazyGetter(this, "randomURI", function() {
   return "http://localhost:" + httpServer.identity.primaryPort + randomPath;
 });
 
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -109,12 +110,13 @@ function run_test()
   os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   us.scheduleUpdate(make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/manifest"),
                     make_uri("http://localhost:" +
                              httpServer.identity.primaryPort + "/masterEntry"),
+                    systemPrincipal,
                     null);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_offlinecache_custom-directory.js
+++ b/netwerk/test/unit/test_offlinecache_custom-directory.js
@@ -5,28 +5,30 @@
 /**
  * This test executes nsIOfflineCacheUpdateService.scheduleAppUpdate API
  * 1. preloads an app with a manifest to a custom sudir in the profile (for simplicity)
  * 2. observes progress and completion of the update
  * 3. checks presence of index.sql and files in the expected location
  */
 
 Cu.import("resource://testing-common/httpd.js");
+Cu.import('resource://gre/modules/Services.jsm');
 
 var httpServer = null;
 var cacheUpdateObserver = null;
+var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel2(url,
                          "",
                          null,
                          null,      // aLoadingNode
-                         Services.scriptSecurityManager.getSystemPrincipal(),
+                         systemPrincipal,
                          null,      // aTriggeringPrincipal
                          Ci.nsILoadInfo.SEC_NORMAL,
                          Ci.nsIContentPolicy.TYPE_OTHER);
 }
 
 function make_uri(url) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
@@ -119,16 +121,17 @@ function run_test()
   // Set this pref to mimic the default browser behavior.
   ps.setComplexValue("browser.cache.offline.parent_directory", Ci.nsILocalFile, profileDir);
 
   var us = Cc["@mozilla.org/offlinecacheupdate-service;1"].
            getService(Ci.nsIOfflineCacheUpdateService);
   var update = us.scheduleAppUpdate(
       make_uri("http://localhost:4444/manifest"),
       make_uri("http://localhost:4444/masterEntry"),
+      systemPrincipal,
       0 /* no AppID */, false /* not in browser*/,
       customDir);
 
   var expectedStates = [
       Ci.nsIOfflineCacheUpdateObserver.STATE_DOWNLOADING,
       Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMSTARTED,
       Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMPROGRESS,
       Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMCOMPLETED,
--- a/netwerk/test/unit/test_pinned_app_cache.js
+++ b/netwerk/test/unit/test_pinned_app_cache.js
@@ -135,16 +135,17 @@ function do_app_cache(manifestURL, pageU
 		     "pin-app",
                      pinned ?
                      Ci.nsIPermissionManager.ALLOW_ACTION :
                      Ci.nsIPermissionManager.DENY_ACTION);
 
   let update =
     update_service.scheduleUpdate(manifestURL,
                                   pageURL,
+                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                   null); /* no window */
 
   return update;
 }
 
 function watch_update(update, stateChangeHandler, cacheAvailHandler) {
   let observer = {
     QueryInterface: function QueryInterface(iftype) {