aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index c77ed80cff9..3d3d7dde2a7 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -45,6 +45,7 @@ use dom::performance::Performance;
use dom::promise::Promise;
use dom::screen::Screen;
use dom::storage::Storage;
+use dom::testrunner::TestRunner;
use euclid::{Point2D, Rect, Size2D};
use fetch;
use ipc_channel::ipc::{self, IpcSender};
@@ -239,6 +240,8 @@ pub struct Window {
/// All the MediaQueryLists we need to update
media_query_lists: WeakMediaQueryListVec,
+
+ test_runner: MutNullableHeap<JS<TestRunner>>,
}
impl Window {
@@ -881,6 +884,10 @@ impl WindowMethods for Window {
fn Fetch(&self, input: RequestOrUSVString, init: &RequestInit) -> Rc<Promise> {
fetch::Fetch(&self.upcast(), input, init)
}
+
+ fn TestRunner(&self) -> Root<TestRunner> {
+ self.test_runner.or_init(|| TestRunner::new(self.upcast()))
+ }
}
impl Window {
@@ -1588,6 +1595,7 @@ impl Window {
error_reporter: error_reporter,
scroll_offsets: DOMRefCell::new(HashMap::new()),
media_query_lists: WeakMediaQueryListVec::new(),
+ test_runner: Default::default(),
};
WindowBinding::Wrap(runtime.cx(), win)