Bug 1888590 - Mark some subtests on trusted-types-event-handlers.html as failing...
[gecko.git] / toolkit / actors / TestProcessActorParent.jsm
blobdfa1fc1df0e9f533d3e9651b2d5ec68a310c7a4d
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 var EXPORTED_SYMBOLS = ["TestProcessActorParent"];
9 class TestProcessActorParent extends JSProcessActorParent {
10   constructor() {
11     super();
12     this.wrappedJSObject = this;
13     this.sawActorCreated = false;
14   }
16   actorCreated() {
17     this.sawActorCreated = true;
18   }
20   receiveMessage(aMessage) {
21     switch (aMessage.name) {
22       case "init":
23         aMessage.data.initial = true;
24         this.sendAsyncMessage("toChild", aMessage.data);
25         break;
26       case "toParent":
27         aMessage.data.toParent = true;
28         this.sendAsyncMessage("done", aMessage.data);
29         break;
30       case "asyncMul":
31         let { a, b } = aMessage.data;
32         return { result: a * b };
33     }
35     return undefined;
36   }
38   show() {
39     return "TestProcessActorParent";
40   }