mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
Merge pull request #779 from lightpanda-io/waitForNavigation
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Internal navigation should change the CDP loader-id
This commit is contained in:
@@ -1369,9 +1369,7 @@ test "Browser.HTML.HtmlInputElement.propeties.form" {
|
|||||||
|
|
||||||
try runner.testCases(&.{
|
try runner.testCases(&.{
|
||||||
.{ "let elem_input = document.querySelector('input')", null },
|
.{ "let elem_input = document.querySelector('input')", null },
|
||||||
}, .{});
|
.{ "elem_input.form", "[object HTMLFormElement]" }, // Initial value
|
||||||
try runner.testCases(&.{.{ "elem_input.form", "[object HTMLFormElement]" }}, .{}); // Initial value
|
|
||||||
try runner.testCases(&.{
|
|
||||||
.{ "elem_input.form = 'foo'", null },
|
.{ "elem_input.form = 'foo'", null },
|
||||||
.{ "elem_input.form", "[object HTMLFormElement]" }, // Invalid
|
.{ "elem_input.form", "[object HTMLFormElement]" }, // Invalid
|
||||||
}, .{});
|
}, .{});
|
||||||
|
|||||||
@@ -85,13 +85,15 @@ fn putAssumeCapacity(headers: *std.ArrayListUnmanaged(std.http.Header), extra: s
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn httpRequestFail(arena: Allocator, bc: anytype, request: *const Notification.RequestFail) !void {
|
pub fn httpRequestFail(arena: Allocator, bc: anytype, request: *const Notification.RequestFail) !void {
|
||||||
|
// It's possible that the request failed because we aborted when the client
|
||||||
|
// sent Target.closeTarget. In that case, bc.session_id will be cleared
|
||||||
|
// already, and we can skip sending these messages to the client.
|
||||||
|
const session_id = bc.session_id orelse return;
|
||||||
|
|
||||||
// Isn't possible to do a network request within a Browser (which our
|
// Isn't possible to do a network request within a Browser (which our
|
||||||
// notification is tied to), without a page.
|
// notification is tied to), without a page.
|
||||||
std.debug.assert(bc.session.page != null);
|
std.debug.assert(bc.session.page != null);
|
||||||
|
|
||||||
// all unreachable because we _have_ to have a page.
|
|
||||||
const session_id = bc.session_id orelse unreachable;
|
|
||||||
|
|
||||||
// We're missing a bunch of fields, but, for now, this seems like enough
|
// We're missing a bunch of fields, but, for now, this seems like enough
|
||||||
try bc.cdp.sendEvent("Network.loadingFailed", .{
|
try bc.cdp.sendEvent("Network.loadingFailed", .{
|
||||||
.requestId = try std.fmt.allocPrint(arena, "REQ-{d}", .{request.id}),
|
.requestId = try std.fmt.allocPrint(arena, "REQ-{d}", .{request.id}),
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ pub fn pageNavigate(arena: Allocator, bc: anytype, event: *const Notification.Pa
|
|||||||
std.debug.assert(bc.session.page != null);
|
std.debug.assert(bc.session.page != null);
|
||||||
|
|
||||||
var cdp = bc.cdp;
|
var cdp = bc.cdp;
|
||||||
|
|
||||||
|
if (event.opts.reason != .address_bar) {
|
||||||
|
bc.loader_id = bc.cdp.loader_id_gen.next();
|
||||||
|
}
|
||||||
|
|
||||||
const loader_id = bc.loader_id;
|
const loader_id = bc.loader_id;
|
||||||
const target_id = bc.target_id orelse unreachable;
|
const target_id = bc.target_id orelse unreachable;
|
||||||
const session_id = bc.session_id orelse unreachable;
|
const session_id = bc.session_id orelse unreachable;
|
||||||
|
|||||||
Reference in New Issue
Block a user