2 // Run test script in content process instead of chrome (xpcshell's default)
6 let ChannelEventSink2 = {
7 _classDescription: "WebRequest channel event sink",
8 _classID: Components.ID("115062f8-92f1-11e5-8b7f-08001110f7ec"),
9 _contractID: "@mozilla.org/webrequest/channel-event-sink;1",
11 QueryInterface: ChromeUtils.generateQI(["nsIChannelEventSink", "nsIFactory"]),
15 .QueryInterface(Ci.nsIComponentRegistrar)
18 this._classDescription,
25 Services.catMan.addCategoryEntry(
26 "net-channel-event-sinks",
36 .QueryInterface(Ci.nsIComponentRegistrar)
37 .unregisterFactory(this._classID, ChannelEventSink2);
38 Services.catMan.deleteCategoryEntry(
39 "net-channel-event-sinks",
45 // nsIChannelEventSink implementation
46 asyncOnChannelRedirect(oldChannel, newChannel, flags, redirectCallback) {
47 // Abort the redirection
48 redirectCallback.onRedirectVerifyCallback(Cr.NS_ERROR_NO_INTERFACE);
51 // nsIFactory implementation
53 return this.QueryInterface(iid);
57 add_task(async function run_test() {
58 ChannelEventSink2.init();
59 ChannelEventSink2.register();
61 run_test_in_child("child_veto_in_parent.js");
62 await do_await_remote_message("child-test-done");
63 ChannelEventSink2.unregister();