<!DOCTYPE HTML><html><!--Test that a image decoding error producs a net:failed-to-process-uri-contentobserver event with the nsIURI of the failed image as the subject--><head><title>Test for image net:failed-to-process-uri-content</title><scriptsrc="/tests/SimpleTest/SimpleTest.js"></script><linkrel="stylesheet"type="text/css"href="/tests/SimpleTest/test.css"/></head><body><pid="display"></p><preid="test"></pre><scripttype="application/javascript">SimpleTest.waitForExplicitFinish();constCi=SpecialPowers.Ci;constCc=SpecialPowers.Cc;varobs=Cc["@mozilla.org/observer-service;1"].getService();obs=obs.QueryInterface(Ci.nsIObserverService);varobserver={QueryInterface(aIID){if(aIID.equals(Ci.nsISupports)||aIID.equals(Ci.nsIObserver))returnthis;throwComponents.Exception("",Cr.NS_ERROR_NO_INTERFACE);},observe(subject,topic){ok(topic=="net:failed-to-process-uri-content","wrong topic");subject=subject.QueryInterface(Ci.nsIURI);is(subject.asciiSpec,`${location.origin}/tests/image/test/mochitest/invalid.jpg`,"wrong subject");obs.removeObserver(this,"net:failed-to-process-uri-content");SimpleTest.finish();}};obs.addObserver(SpecialPowers.wrapCallbackObject(observer),"net:failed-to-process-uri-content");document.write('<img src="damon.jpg">');document.write('<img src="invalid.jpg">');</script></body></html>