1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/tests/regorder/extension/extComponent.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +var gRegTestExtComponent = 1.11 +{ 1.12 + /* nsISupports implementation. */ 1.13 + QueryInterface: function (aIID) 1.14 + { 1.15 + if (!aIID.equals(Components.interfaces.nsISupports) && 1.16 + !aIID.equals(Components.interfaces.nsIFactory)) 1.17 + throw Components.results.NS_ERROR_NO_INTERFACE; 1.18 + 1.19 + return this; 1.20 + }, 1.21 + 1.22 + /* nsIFactory implementation. */ 1.23 + createInstance: function (aOuter, aIID) 1.24 + { 1.25 + if (null != aOuter) 1.26 + throw Components.results.NS_ERROR_NO_AGGREGATION; 1.27 + 1.28 + return this.QueryInterface(aIID); 1.29 + }, 1.30 + 1.31 + lockFactory: function (aDoLock) {} 1.32 +}; 1.33 + 1.34 +const kClassID = Components.ID("{fe64efb7-c5ab-41a6-b639-e6c0f483181e}"); 1.35 +this.NSGetFactory = function NSGetFactory(cid) 1.36 +{ 1.37 + if (!cid.equals(kClassID)) 1.38 + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; 1.39 + 1.40 + return gRegTestExtComponent; 1.41 +}