1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/metro/base/tests/mochiperf/msgmanagerecho.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,28 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +/* 1.9 + * TestEchoReceiver - receives json data, reserializes it and send it back. 1.10 + */ 1.11 + 1.12 +"use strict"; 1.13 + 1.14 +var TestEchoReceiver = { 1.15 + init: function init() { 1.16 + addMessageListener("Test:EchoRequest", this); 1.17 + }, 1.18 + 1.19 + receiveMessage: function receiveMessage(aMessage) { 1.20 + let json = aMessage.json; 1.21 + switch (aMessage.name) { 1.22 + case "Test:EchoRequest": 1.23 + sendAsyncMessage("Test:EchoResponse", json); 1.24 + break; 1.25 + } 1.26 + }, 1.27 + 1.28 +}; 1.29 + 1.30 +TestEchoReceiver.init(); 1.31 +