summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/components/js/xpctest_interfaces.js
blob: 12da40af81a42b5dd58acc6deb7581a9aed08f77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const {ComponentUtils} = ChromeUtils.import("resource://gre/modules/ComponentUtils.jsm");

function TestInterfaceA() {}
TestInterfaceA.prototype = {

  /* Boilerplate */
  QueryInterface: ChromeUtils.generateQI(["nsIXPCTestInterfaceA"]),
  contractID: "@mozilla.org/js/xpc/test/js/TestInterfaceA;1",
  classID: Components.ID("{3c8fd2f5-970c-42c6-b5dd-cda1c16dcfd8}"),

  /* nsIXPCTestInterfaceA */
  name: "TestInterfaceADefaultName"
};

function TestInterfaceB() {}
TestInterfaceB.prototype = {

  /* Boilerplate */
  QueryInterface: ChromeUtils.generateQI(["nsIXPCTestInterfaceB"]),
  contractID: "@mozilla.org/js/xpc/test/js/TestInterfaceB;1",
  classID: Components.ID("{ff528c3a-2410-46de-acaa-449aa6403a33}"),

  /* nsIXPCTestInterfaceA */
  name: "TestInterfaceADefaultName"
};

function TestInterfaceAll() {}
TestInterfaceAll.prototype = {

  /* Boilerplate */
  QueryInterface: ChromeUtils.generateQI(["nsIXPCTestInterfaceA",
                                          "nsIXPCTestInterfaceB",
                                          "nsIXPCTestInterfaceC"]),
  contractID: "@mozilla.org/js/xpc/test/js/TestInterfaceAll;1",
  classID: Components.ID("{90ec5c9e-f6da-406b-9a38-14d00f59db76}"),

  /* nsIXPCTestInterfaceA / nsIXPCTestInterfaceB */
  name: "TestInterfaceAllDefaultName",

  /* nsIXPCTestInterfaceC */
  someInteger: 42
};

var NSGetFactory = ComponentUtils.generateNSGetFactory([TestInterfaceA, TestInterfaceB, TestInterfaceAll]);