Skip to content

Commit

Permalink
refactor: changed firefox to firefoxProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
shubheksha committed Aug 22, 2016
1 parent 1dd0f06 commit 6b6d65d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/cmd/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function defaultWatcherCreator(

export type ReloadStrategyParams = {
addonId: string,
firefoxApp: FirefoxProcess,
firefoxProcess: FirefoxProcess,
client: RemoteFirefox,
profile: FirefoxProfile,
sourceDir: string,
Expand All @@ -75,15 +75,15 @@ export type ReloadStrategyOptions = {

export function defaultReloadStrategy(
{
addonId, firefoxApp, client, profile, sourceDir, artifactsDir,
addonId, firefoxProcess, client, profile, sourceDir, artifactsDir,
}: ReloadStrategyParams,
{
createWatcher=defaultWatcherCreator,
}: ReloadStrategyOptions = {}
): void {
let watcher: Watchpack;

firefoxApp.on('close', () => {
firefoxProcess.on('close', () => {
client.disconnect();
watcher.close();
});
Expand Down Expand Up @@ -261,7 +261,7 @@ export default function run(
log.debug(
`Reloading extension when the source changes; id=${addonId}`);
reloadStrategy({
firefoxApp: runningFirefox,
firefoxProcess: runningFirefox,
profile, client, sourceDir, artifactsDir, addonId,
});
}
Expand Down
6 changes: 3 additions & 3 deletions tests/test-cmd/test.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('run', () => {
addonId: 'some-addon@test-suite',
client,
// $FLOW_IGNORE: fake a Firefox ChildProcess using an EventEmitter for testing reasons.
firefoxApp: new EventEmitter(),
firefoxProcess: new EventEmitter(),
profile: {},
sourceDir: '/path/to/extension/source',
artifactsDir: '/path/to/web-ext-artifacts/',
Expand All @@ -330,9 +330,9 @@ describe('run', () => {
}

it('cleans up connections when firefox closes', () => {
const {firefoxApp, client, watcher, reloadStrategy} = prepare();
const {firefoxProcess, client, watcher, reloadStrategy} = prepare();
reloadStrategy();
firefoxApp.emit('close');
firefoxProcess.emit('close');
assert.equal(client.client.disconnect.called, true);
assert.equal(watcher.close.called, true);
});
Expand Down

0 comments on commit 6b6d65d

Please sign in to comment.