Skip to content

Commit 7abdf64

Browse files
authored
Merge pull request #136 from chrome-php/dev-v0.8.1
Dev v0.8.1
2 parents 5caadeb + 81d4df7 commit 7abdf64

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@
1212
* none
1313

1414

15+
## 0.8.1
16+
17+
> *2020-02-20*
18+
19+
> Description
20+
21+
* Bug fixes:
22+
* fixed browser close
23+
* fixed unit tests
24+
* testing php 7.3 and 7.4
25+
26+
1527
## 0.8.0
1628

17-
> *2020-02-20* (not released)
29+
> *2020-02-20*
1830
1931
* Features:
2032
* Added Page::pdf (thanks @tanasecosminromeo)

src/Browser.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ public function setPagePreScript(string $script = null)
9999
*/
100100
public function close()
101101
{
102-
// TODO check browser.close on chrome 63
102+
$this->sendCloseMessage();
103+
}
104+
105+
/**
106+
* Send close message to the browser
107+
* @throws OperationTimedOut
108+
*/
109+
final public function sendCloseMessage()
110+
{
103111
$r = $this->connection->sendMessageSync(new Message('Browser.close'));
104112
if (!$r->isSuccessful()) {
105113
// log

src/Browser/BrowserProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function kill()
190190
try {
191191
// log
192192
$this->logger->debug('process: trying to close chrome gracefully');
193-
$this->browser->close();
193+
$this->browser->sendCloseMessage();
194194
} catch (\Exception $e) {
195195
//log
196196
$this->logger->debug('process: closing chrome gracefully - compatibility');

test/suites/HttpEnabledTestCase.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@ public static function setUpBeforeClass()
1919

2020
self::$process = new Process([
2121
'php',
22-
'-S localhost:8083',
23-
'-t ' . __DIR__ . '/../resources/static-web'
22+
'-S',
23+
'localhost:8083',
24+
'-t',
25+
__DIR__ . '/../resources/static-web'
2426
]);
2527
self::$process->start();
26-
usleep(10000); //wait for server to get going
28+
usleep(80000); //wait for server to get going
29+
30+
// ensure it started
31+
if (!self::$process->isRunning()) {
32+
$message = self::$process->getErrorOutput();
33+
throw new \Exception('Cannot start webserver for tests: ' . $message);
34+
}
2735
}
2836

2937
public static function tearDownAfterClass()

0 commit comments

Comments
 (0)