Listening to Ad Auction Worklet Events
bjoberg opened this issue ยท 5 comments
Question
Is it possible to add event listeners to Ad Auction Worklet events?
Background
I am trying to write automation tests for my team's Protected Audience integration; however, I am struggling to validate that certain points of the auction workflow have completed. In a perfect world, I would be able to listen and assert for certain auction events within my tests.
I would love to be able to do something like this:
window.addEventListener('adauctionload', handleEvent);
window.addEventListener('adauctionbid', handleEvent);
window.addEventListener('adauctiontoplevelbid', handleEvent);
window.addEventListener('adauctiontoplevelwin', handleEvent);
Not via normal events; there are Chrome Devtools Protocol events for some of this.
Got it, I have used the devtools break points during manual testing ๐. Are there any future plans to add normal events?
I think regular events would likely mess with isolation/privacy properties.
Anyway, there are:
https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-interestGroupAccessed
https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-interestGroupAuctionEventOccurred
https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-interestGroupAuctionNetworkRequestCreated
enabled/disabled via
https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-setInterestGroupTracking
https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-setInterestGroupAuctionTracking
(and also Network.enable/disable)
...interestGroupAccessed in particular has some of the events you mentioned: https://chromedevtools.github.io/devtools-protocol/tot/Storage/#type-InterestGroupAccessType
Thanks @dmdabbs and @morlovich!