mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
Merge pull request #453 from lightpanda-io/loop-reset
Some checks failed
e2e-test / zig build release (push) Waiting to run
e2e-test / puppeteer-perf (push) Blocked by required conditions
e2e-test / demo-scripts (push) Blocked by required conditions
wpt / web platform tests (push) Waiting to run
wpt / perf-fmt (push) Blocked by required conditions
zig-test / zig build dev (push) Waiting to run
zig-test / zig test (push) Waiting to run
zig-test / perf-fmt (push) Blocked by required conditions
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
Some checks failed
e2e-test / zig build release (push) Waiting to run
e2e-test / puppeteer-perf (push) Blocked by required conditions
e2e-test / demo-scripts (push) Blocked by required conditions
wpt / web platform tests (push) Waiting to run
wpt / perf-fmt (push) Blocked by required conditions
zig-test / zig build dev (push) Waiting to run
zig-test / zig test (push) Waiting to run
zig-test / perf-fmt (push) Blocked by required conditions
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
Reset loop event after page stop.
This commit is contained in:
36
.github/workflows/e2e-test.yml
vendored
36
.github/workflows/e2e-test.yml
vendored
@@ -57,8 +57,8 @@ jobs:
|
|||||||
zig-out/bin/lightpanda
|
zig-out/bin/lightpanda
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
puppeteer:
|
puppeteer-perf:
|
||||||
name: puppeteer
|
name: puppeteer-perf
|
||||||
needs: zig-build-release
|
needs: zig-build-release
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -105,3 +105,35 @@ jobs:
|
|||||||
echo "puppeteer avg duration: $PUPPETEER_AVG_DURATION"
|
echo "puppeteer avg duration: $PUPPETEER_AVG_DURATION"
|
||||||
test "$PUPPETEER_AVG_DURATION" -le "$MAX_AVG_DURATION"
|
test "$PUPPETEER_AVG_DURATION" -le "$MAX_AVG_DURATION"
|
||||||
|
|
||||||
|
demo-scripts:
|
||||||
|
name: demo-scripts
|
||||||
|
needs: zig-build-release
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: 'lightpanda-io/demo'
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- run: npm install
|
||||||
|
|
||||||
|
- name: download artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: lightpanda-build-release
|
||||||
|
|
||||||
|
- run: chmod a+x ./lightpanda
|
||||||
|
|
||||||
|
- name: run puppeteer links
|
||||||
|
run: |
|
||||||
|
./lightpanda serve & echo $! > LPD.pid
|
||||||
|
node puppeteer/links.js || exit 1
|
||||||
|
kill `cat LPD.pid`
|
||||||
|
|
||||||
|
- name: run puppeteer dump
|
||||||
|
run: |
|
||||||
|
./lightpanda serve & echo $! > LPD.pid
|
||||||
|
node puppeteer/dump.js || exit 1
|
||||||
|
kill `cat LPD.pid`
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ pub const Session = struct {
|
|||||||
loader: Loader,
|
loader: Loader,
|
||||||
|
|
||||||
env: Env,
|
env: Env,
|
||||||
|
loop: *Loop,
|
||||||
inspector: jsruntime.Inspector,
|
inspector: jsruntime.Inspector,
|
||||||
|
|
||||||
window: Window,
|
window: Window,
|
||||||
@@ -143,6 +144,7 @@ pub const Session = struct {
|
|||||||
.storageShed = storage.Shed.init(allocator),
|
.storageShed = storage.Shed.init(allocator),
|
||||||
.arena = std.heap.ArenaAllocator.init(allocator),
|
.arena = std.heap.ArenaAllocator.init(allocator),
|
||||||
.window = Window.create(null, .{ .agent = user_agent }),
|
.window = Window.create(null, .{ .agent = user_agent }),
|
||||||
|
.loop = loop,
|
||||||
};
|
};
|
||||||
|
|
||||||
const arena = self.arena.allocator();
|
const arena = self.arena.allocator();
|
||||||
@@ -278,6 +280,9 @@ pub const Page = struct {
|
|||||||
|
|
||||||
// reset js env and mem arena.
|
// reset js env and mem arena.
|
||||||
pub fn end(self: *Page) void {
|
pub fn end(self: *Page) void {
|
||||||
|
// Reset all existing callbacks.
|
||||||
|
self.session.loop.reset();
|
||||||
|
|
||||||
self.session.env.stop();
|
self.session.env.stop();
|
||||||
// TODO unload document: https://html.spec.whatwg.org/#unloading-documents
|
// TODO unload document: https://html.spec.whatwg.org/#unloading-documents
|
||||||
|
|
||||||
|
|||||||
2
vendor/zig-js-runtime
vendored
2
vendor/zig-js-runtime
vendored
Submodule vendor/zig-js-runtime updated: 944c5f0a26...c7f980e594
Reference in New Issue
Block a user