michael@0: const Cc = Components.classes; michael@0: const Ci = Components.interfaces; michael@0: const Cu = Components.utils; michael@0: michael@0: function run_test() { michael@0: var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager); michael@0: do_check_true(secMan.isSystemPrincipal(Cu.getObjectPrincipal({}))); michael@0: var sb = new Cu.Sandbox('http://www.example.com'); michael@0: Cu.evalInSandbox('var obj = { foo: 42 };', sb); michael@0: do_check_eq(Cu.getObjectPrincipal(sb.obj).origin, 'http://www.example.com'); michael@0: }