Skip to content

Commit

Permalink
try running on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
krisselden committed Feb 2, 2016
1 parent 56087e9 commit f1fd3e5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ chrome-debugging-client
Example:

```js
import { createSession } from "./index";
import { createSession } from "chrome-debugging-client";

createSession(async (session) => {
let process = await session.spawn("canary");
Expand Down
17 changes: 14 additions & 3 deletions test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { createSession } from "./index";

createSession(async (session) => {
let process = await session.spawn("canary");
let client = session.createAPIClient("localhost", process.remoteDebuggingPort);
let browserType;
let resolverOptions;
if (process.env.CHROME_BIN) {
browserType = "exact";
resolverOptions = {
executablePath: process.env.CHROME_BIN
};
} else {
browserType = "canary";
}
let browser = await session.spawn(browserType, resolverOptions);
let client = session.createAPIClient("localhost", browser.remoteDebuggingPort);
let version = await client.version();
console.log(JSON.stringify(version, null, 2));
let tabs = await client.listTabs();
Expand All @@ -20,4 +30,5 @@ createSession(async (session) => {
console.log(data.snapshot.meta);
}).catch((err) => {
console.error(err);
});
process.exit(1);
});
8 changes: 8 additions & 0 deletions travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- "4.1"

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

0 comments on commit f1fd3e5

Please sign in to comment.