Files
tubestation/dom/xml/test/file_bug392338.js
Kris Maglione 0bb74efdf1 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00

23 lines
861 B
JavaScript

ChromeUtils.import("resource://gre/modules/Services.jsm");
var modifyObserver = {
observe: function(subject, topic, data) {
if (topic == 'http-on-modify-request') {
var testOk = false;
try {
// We should be able to QI the request to an nsIChannel, then get
// the notificationCallbacks without throwing an exception.
var ir = subject.QueryInterface(Components.interfaces.nsIChannel).notificationCallbacks;
// The notificationCallbacks should be an nsIInterfaceRequestor.
testOk = ir.toString().indexOf(Components.interfaces.nsIInterfaceRequestor) != -1;
} catch (e) {
}
sendAsyncMessage('modify-request-completed', testOk);
Services.obs.removeObserver(modifyObserver, 'http-on-modify-request');
}
}
};
Services.obs.addObserver(modifyObserver, 'http-on-modify-request');