Bug 1290599 - Part 2: Fix the browser_toolbox_transport_events.js test r=jryans
authorJarda Snajdr <jsnajdr@gmail.com>
Thu, 11 Aug 2016 16:47:22 +0200
changeset 400409 a1ab21952abc22e082c9dea36d0e0d3febaf9982
parent 400408 51600f3f15c23697b5062752a83f5addc4c0e7e0
child 400410 8fd2f35a58fa11f9fb6e356ce37528c6e7e0f728
push id26138
push usergszorc@mozilla.com
push dateSat, 13 Aug 2016 03:04:36 +0000
reviewersjryans
bugs1290599
milestone51.0a1
Bug 1290599 - Part 2: Fix the browser_toolbox_transport_events.js test r=jryans MozReview-Commit-ID: 3Ck8o29f93K
devtools/client/framework/test/browser_toolbox_transport_events.js
--- a/devtools/client/framework/test/browser_toolbox_transport_events.js
+++ b/devtools/client/framework/test/browser_toolbox_transport_events.js
@@ -1,13 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const { on, off } = require("sdk/event/core");
 const { DebuggerClient } = require("devtools/shared/client/main");
 
 function test() {
   gDevTools.on("toolbox-created", onToolboxCreated);
   on(DebuggerClient, "connect", onDebuggerClientConnect);
 
   addTab("about:blank").then(function () {
@@ -68,21 +70,21 @@ function onPacket1(eventId, packet) {
 }
 
 function onToolboxCreated(eventId, toolbox) {
   toolbox.target.makeRemote();
   let client = toolbox.target.client;
   let transport = client._transport;
 
   transport.on("send", send1);
-  transport.on("onPacket", onPacket1);
+  transport.on("packet", onPacket1);
 
   client.addOneTimeListener("closed", event => {
     transport.off("send", send1);
-    transport.off("onPacket", onPacket1);
+    transport.off("packet", onPacket1);
   });
 }
 
 // Listen to all debugger client object protocols.
 var sent2 = [];
 var received2 = [];
 
 function send2(eventId, packet) {
@@ -92,15 +94,15 @@ function send2(eventId, packet) {
 function onPacket2(eventId, packet) {
   received2.push(packet);
 }
 
 function onDebuggerClientConnect(client) {
   let transport = client._transport;
 
   transport.on("send", send2);
-  transport.on("onPacket", onPacket2);
+  transport.on("packet", onPacket2);
 
   client.addOneTimeListener("closed", event => {
     transport.off("send", send2);
-    transport.off("onPacket", onPacket2);
+    transport.off("packet", onPacket2);
   });
 }