Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Dart

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest

env:
DISPLAY: ':99'

steps:
- uses: actions/checkout@v2
- uses: cedx/setup-dart@v2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - I'd hit this as well wrt chromedriver not being available in the dart container

with:
release-channel: stable
version: latest

- name: Print Dart SDK version
run: dart --version

- name: Install dependencies
run: dart pub get

- name: Analyze project source
run: dart analyze

- name: Run Xvfb
run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

- name: Run tests
run: dart test
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.8

- Log `STDERR` on Chrome launch failure.

## 0.1.7

- Widen the dependency range on `package:webkit_inspection_protocol`.
Expand Down
21 changes: 14 additions & 7 deletions lib/src/chrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,20 @@ class Chrome {
final process = await _startProcess(urls, args: args);

// Wait until the DevTools are listening before trying to connect.
await process.stderr
.transform(utf8.decoder)
.transform(const LineSplitter())
.firstWhere((line) => line.startsWith('DevTools listening'))
.timeout(Duration(seconds: 60),
onTimeout: () =>
throw Exception('Unable to connect to Chrome DevTools.'));
var _errorLines = <String>[];
try {
await process.stderr
.transform(utf8.decoder)
.transform(const LineSplitter())
.firstWhere((line) {
_errorLines.add(line);
return line.startsWith('DevTools listening');
}).timeout(Duration(seconds: 60));
} catch (_) {
throw Exception('Unable to connect to Chrome DevTools.\n\n'
'Chrome STDERR:\n' +
_errorLines.join('\n'));
}

return _connect(Chrome._(
port,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: browser_launcher
description: Provides a standardized way to launch web browsers for testing and tools.

version: 0.1.7
version: 0.1.8

homepage: https://github.com/dart-lang/browser_launcher

Expand Down