registertestactors-lazy.js (805B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 var { 7 RetVal, 8 Actor, 9 FrontClassWithSpec, 10 generateActorSpec, 11 } = require("resource://devtools/shared/protocol.js"); 12 13 const lazySpec = generateActorSpec({ 14 typeName: "lazy", 15 16 methods: { 17 hello: { 18 response: { str: RetVal("string") }, 19 }, 20 }, 21 }); 22 23 class LazyActor extends Actor { 24 constructor(conn) { 25 super(conn, lazySpec); 26 27 Services.obs.notifyObservers(null, "actor", "instantiated"); 28 } 29 30 hello() { 31 return "world"; 32 } 33 } 34 exports.LazyActor = LazyActor; 35 36 Services.obs.notifyObservers(null, "actor", "loaded"); 37 38 class LazyFront extends FrontClassWithSpec(lazySpec) { 39 constructor(client) { 40 super(client); 41 } 42 } 43 exports.LazyFront = LazyFront;