[go: nahoru, domu]

Skip to content

Commit

Permalink
Rename and export launcher class.
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed May 15, 2017
1 parent d117474 commit 377b063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions chrome-launcher/chrome-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface LaunchedChrome {
export async function launch(opts: Options = {}): Promise<LaunchedChrome> {
opts.handleSIGINT = defaults(opts.handleSIGINT, true);

const instance = new ChromeLauncher(opts);
const instance = new Launcher(opts);

// Kill spawned Chrome process in case of ctrl-C.
if (opts.handleSIGINT) {
Expand All @@ -67,7 +67,7 @@ export async function launch(opts: Options = {}): Promise<LaunchedChrome> {
return {pid: instance.pid!, port: instance.port, kill: instance.kill};
}

class ChromeLauncher {
export class Launcher {
private tmpDirandPidFileReady = false;
pollInterval: number = 500;
TMP_PROFILE_DIR: string;
Expand Down
10 changes: 5 additions & 5 deletions chrome-launcher/test/chrome-launcher-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@

require('../compiled-check.js')('chrome-launcher.js');

const ChromeLauncher = require('../chrome-launcher.js').ChromeLauncher;
const ChromeLauncher = require('../chrome-launcher.js').Launcher;
const log = require('../../lighthouse-core/lib/log');
const assert = require('assert');

/* eslint-env mocha */

describe('ChromeLauncher', () => {
describe('Launcher', () => {
it('doesn\'t fail when killed twice', () => {
log.setLevel('error');
const chromeInstance = new ChromeLauncher();
return chromeInstance.run().then(() => {
return chromeInstance.launch().then(() => {
log.setLevel();
return Promise.all([chromeInstance.kill(), chromeInstance.kill()]);
});
Expand All @@ -38,10 +38,10 @@ describe('ChromeLauncher', () => {
log.setLevel('error');
const chromeInstance = new ChromeLauncher();
let pid;
return chromeInstance.run()
return chromeInstance.launch()
.then(() => {
pid = chromeInstance.chrome.pid;
return chromeInstance.run();
return chromeInstance.launch();
})
.then(() => {
log.setLevel();
Expand Down

0 comments on commit 377b063

Please sign in to comment.