feat(script): add {DissimilarOriginWindow, PaintWorkletGlobalScope, TestWorkletGlobalScope}::origin

This commit is contained in:
yvt 2021-07-11 23:20:39 +09:00
parent bfa2026220
commit 5959c2ef9b
4 changed files with 19 additions and 2 deletions

View file

@ -15,7 +15,7 @@ use crossbeam_channel::Sender;
use dom_struct::dom_struct;
use js::rust::Runtime;
use msg::constellation_msg::PipelineId;
use servo_url::ServoUrl;
use servo_url::{MutableOrigin, ServoUrl};
use std::collections::HashMap;
// check-tidy: no specs after this line
@ -53,6 +53,10 @@ impl TestWorkletGlobalScope {
unsafe { TestWorkletGlobalScopeBinding::Wrap(JSContext::from_ptr(runtime.cx()), global) }
}
pub fn origin(&self) -> &MutableOrigin {
self.worklet_global.origin()
}
pub fn perform_a_worklet_task(&self, task: TestWorkletTask) {
match task {
TestWorkletTask::Lookup(key, sender) => {