Backed out changeset 713114c0331a (bug 1938707) by developer request CLOSED TREE
[gecko.git] / js / xpconnect / tests / idl / xpctest_returncode.idl
blob5ee6c554791b2d7674db64dd6b5ae8467855cb77
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 * Test the use of Components.returnCode
10 * This ("parent") interface defines a method that in-turn calls another
11 * ("child") interface implemented in JS, and returns the nsresult from that
12 * child interface. The child interface manages the return code by way of
13 * Components.returnCode.
16 #include "nsISupports.idl"
19 [scriptable, uuid(479e4532-95cf-48b8-a99b-8a5881e47138)]
20 interface nsIXPCTestReturnCodeParent : nsISupports {
21 // Calls the "child" interface with the specified behavior flag. Returns
22 // the NSRESULT from the child interface.
23 nsresult callChild(in long childBehavior);
26 [scriptable, uuid(672cfd34-1fd1-455d-9901-d879fa6fdb95)]
27 interface nsIXPCTestReturnCodeChild : nsISupports {
28 void doIt(in long behavior);
30 // Flags to control that the child does.
31 // child will throw a JS exception
32 const long CHILD_SHOULD_THROW = 0;
34 // child will just return normally
35 const long CHILD_SHOULD_RETURN_SUCCESS = 1;
37 // child will return after setting Components.returnCode to NS_ERROR_FAILURE
38 const long CHILD_SHOULD_RETURN_RESULTCODE = 2;
40 // child will set Components.returnCode to NS_ERROR_UNEXPECTED, then create
41 // a new component that sets Components.returnCode to NS_ERROR_FAILURE.
42 // Our caller should see the NS_ERROR_UNEXPECTED we set rather than the
43 // value set later by the "inner" child.
44 const long CHILD_SHOULD_NEST_RESULTCODES = 3;