File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,34 @@ fn setIgnoreCertificateErrors(cmd: anytype) !void {
3535 ignore : bool ,
3636 })) orelse return error .InvalidParams ;
3737
38- const bc = cmd .browser_context orelse return error .BrowserContextNotLoaded ;
39-
4038 if (params .ignore ) {
4139 try cmd .cdp .browser .http_client .disableTlsVerify ();
4240 } else {
4341 try cmd .cdp .browser .http_client .enableTlsVerify ();
4442 }
4543
46- return cmd .sendResult (.{
47- .browserContextId = bc .id ,
48- }, .{});
44+ return cmd .sendResult (null , .{});
45+ }
46+
47+ const testing = @import ("../testing.zig" );
48+
49+ test "cdp.Security: setIgnoreCertificateErrors" {
50+ var ctx = testing .context ();
51+ defer ctx .deinit ();
52+
53+ _ = try ctx .loadBrowserContext (.{ .id = "BID-9" });
54+
55+ try ctx .processMessage (.{
56+ .id = 8 ,
57+ .method = "Security.setIgnoreCertificateErrors" ,
58+ .params = .{ .ignore = true },
59+ });
60+ try ctx .expectSentResult (null , .{ .id = 8 });
61+
62+ try ctx .processMessage (.{
63+ .id = 9 ,
64+ .method = "Security.setIgnoreCertificateErrors" ,
65+ .params = .{ .ignore = false },
66+ });
67+ try ctx .expectSentResult (null , .{ .id = 9 });
4968}
You can’t perform that action at this time.
0 commit comments