1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/tests/regorder/core/component.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 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 gRegTestCoreComponent = 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("{56ab1cd4-ac44-4f86-8104-171f8b8f2fc7}"); 1.35 + 1.36 +this.NSGetFactory = 1.37 + function NSGetFactory(aClassID) { 1.38 + if (!aClassID.equals(kClassID)) 1.39 + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; 1.40 + 1.41 + return gRegTestCoreComponent; 1.42 +}