toolkit/actors/TestParent.jsm
author Kris Maglione <maglione.k@gmail.com>
Thu, 14 Feb 2019 17:54:00 -0800
changeset 517406 7436c0f5b8b1583d20d5ea2d1d9d3b2c665bdf33
parent 516121 b482c6618d72ac38a9a82fbccf425e0a7f8b6129
child 518008 33dd29846b7b64da9b31a936ac1b152ef5c95e12
permissions -rw-r--r--
Fix botched backout (bug 1524687). r=bustage

/* vim: set ts=2 sw=2 sts=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";

var EXPORTED_SYMBOLS = ["TestParent"];

class TestParent extends JSWindowActorParent {
  constructor() {
    super();
  }

  recvAsyncMessage(aMessage) {
    switch (aMessage.name) {
      case "init":
        aMessage.data.initial =  true;
        this.sendAsyncMessage("Test", "toChild", aMessage.data);
        break;
      case "toParent":
        aMessage.data.toParent = true;
        this.sendAsyncMessage("Test", "done", aMessage.data);
        break;
    }
  }

  show() {
    return "TestParent";
  }
}