Bug 431986: ApplicationCache doesn't implement EventTarget, patch by dcamp@mozilla.com, r+sr=jst, a=schrep
authorgavin@gavinsharp.com
Thu, 08 May 2008 17:10:49 -0700
changeset 15075 fe51be10a4c6599dfb72dabb4135f1f963c73856
parent 15074 a51060543787c3ba529efd2b96e664383b64d37e
child 15076 e0cc7149a3e4f08c959e9c4da97c66631970abbd
push idunknown
push userunknown
push dateunknown
reviewersschrep
bugs431986
milestone1.9pre
Bug 431986: ApplicationCache doesn't implement EventTarget, patch by dcamp@mozilla.com, r+sr=jst, a=schrep
dom/src/base/nsDOMClassInfo.cpp
dom/tests/mochitest/ajax/offline/test_simpleManifest.html
--- a/dom/src/base/nsDOMClassInfo.cpp
+++ b/dom/src/base/nsDOMClassInfo.cpp
@@ -3308,16 +3308,17 @@ nsDOMClassInfo::Init()
 
   DOM_CLASSINFO_MAP_BEGIN(CommandEvent, nsIDOMCommandEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCommandEvent)
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(OfflineResourceList, nsIDOMOfflineResourceList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMOfflineResourceList)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(LoadStatusList, nsIDOMLoadStatusList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMLoadStatusList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(LoadStatus, nsIDOMLoadStatus)
--- a/dom/tests/mochitest/ajax/offline/test_simpleManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_simpleManifest.html
@@ -92,22 +92,25 @@ function manifestUpdated()
 
   gGotChecking = false;
   gGotDownloading = false;
   applicationCache.update();
 }
 
 
 if (OfflineTest.setup()) {
+  OfflineTest.ok(applicationCache instanceof EventTarget,
+                 "applicationCache should be an event target");
+
   applicationCache.onerror = OfflineTest.failEvent;
 
-  applicationCache.onchecking = function() {
+  applicationCache.addEventListener("checking", function() {
     OfflineTest.is(applicationCache.status, 2, "CHECKING state while checking");
     gGotChecking = true;
-  };
+    }, true);
   applicationCache.ondownloading = function() {
     OfflineTest.is(applicationCache.status, 3, "DOWNLOADING state while checking")
     gGotDownloading = true; };
   applicationCache.oncached = OfflineTest.priv(manifestUpdated);
 }
 
 SimpleTest.waitForExplicitFinish();