michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests that a chrome debugger can be created in a new process. michael@0: */ michael@0: michael@0: let gProcess; michael@0: michael@0: function test() { michael@0: // Windows XP and 8.1 test slaves are terribly slow at this test. michael@0: requestLongerTimeout(5); michael@0: michael@0: initChromeDebugger(aOnClose).then(aProcess => { michael@0: gProcess = aProcess; michael@0: michael@0: info("Starting test..."); michael@0: performTest(); michael@0: }); michael@0: } michael@0: michael@0: function performTest() { michael@0: ok(gProcess._dbgProcess, michael@0: "The remote debugger process wasn't created properly!"); michael@0: ok(gProcess._dbgProcess.isRunning, michael@0: "The remote debugger process isn't running!"); michael@0: is(typeof gProcess._dbgProcess.pid, "number", michael@0: "The remote debugger process doesn't have a pid (?!)"); michael@0: michael@0: info("process location: " + gProcess._dbgProcess.location); michael@0: info("process pid: " + gProcess._dbgProcess.pid); michael@0: info("process name: " + gProcess._dbgProcess.processName); michael@0: info("process sig: " + gProcess._dbgProcess.processSignature); michael@0: michael@0: ok(gProcess._dbgProfile, michael@0: "The remote debugger profile wasn't created properly!"); michael@0: ok(gProcess._dbgProfile.localDir, michael@0: "The remote debugger profile doesn't have a localDir..."); michael@0: ok(gProcess._dbgProfile.rootDir, michael@0: "The remote debugger profile doesn't have a rootDir..."); michael@0: ok(gProcess._dbgProfile.name, michael@0: "The remote debugger profile doesn't have a name..."); michael@0: michael@0: info("profile localDir: " + gProcess._dbgProfile.localDir.path); michael@0: info("profile rootDir: " + gProcess._dbgProfile.rootDir.path); michael@0: info("profile name: " + gProcess._dbgProfile.name); michael@0: michael@0: let profileService = Cc["@mozilla.org/toolkit/profile-service;1"] michael@0: .createInstance(Ci.nsIToolkitProfileService); michael@0: michael@0: let profile = profileService.getProfileByName(gProcess._dbgProfile.name); michael@0: michael@0: ok(profile, michael@0: "The remote debugger profile wasn't *actually* created properly!"); michael@0: is(profile.localDir.path, gProcess._dbgProfile.localDir.path, michael@0: "The remote debugger profile doesn't have the correct localDir!"); michael@0: is(profile.rootDir.path, gProcess._dbgProfile.rootDir.path, michael@0: "The remote debugger profile doesn't have the correct rootDir!"); michael@0: michael@0: gProcess.close(); michael@0: } michael@0: michael@0: function aOnClose() { michael@0: ok(!gProcess._dbgProcess.isRunning, michael@0: "The remote debugger process isn't closed as it should be!"); michael@0: is(gProcess._dbgProcess.exitValue, (Services.appinfo.OS == "WINNT" ? 0 : 256), michael@0: "The remote debugger process didn't die cleanly."); michael@0: michael@0: info("process exit value: " + gProcess._dbgProcess.exitValue); michael@0: michael@0: info("profile localDir: " + gProcess._dbgProfile.localDir.path); michael@0: info("profile rootDir: " + gProcess._dbgProfile.rootDir.path); michael@0: info("profile name: " + gProcess._dbgProfile.name); michael@0: michael@0: finish(); michael@0: } michael@0: michael@0: registerCleanupFunction(function() { michael@0: gProcess = null; michael@0: });