michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Test if request and response body logging stays on after opening the console. michael@0: */ michael@0: michael@0: function test() { michael@0: initNetMonitor(JSON_LONG_URL).then(([aTab, aDebuggee, aMonitor]) => { michael@0: info("Starting test... "); michael@0: michael@0: let { L10N, NetMonitorView } = aMonitor.panelWin; michael@0: let { RequestsMenu } = NetMonitorView; michael@0: michael@0: RequestsMenu.lazyUpdate = false; michael@0: michael@0: function verifyRequest(aOffset) { michael@0: verifyRequestItemTarget(RequestsMenu.getItemAtIndex(aOffset), michael@0: "GET", CONTENT_TYPE_SJS + "?fmt=json-long", { michael@0: status: 200, michael@0: statusText: "OK", michael@0: type: "json", michael@0: fullMimeType: "text/json; charset=utf-8", michael@0: size: L10N.getFormatStr("networkMenu.sizeKB", L10N.numberWithDecimals(85975/1024, 2)), michael@0: time: true michael@0: }); michael@0: } michael@0: michael@0: waitForNetworkEvents(aMonitor, 1).then(() => { michael@0: verifyRequest(0); michael@0: michael@0: aMonitor._toolbox.once("webconsole-selected", () => { michael@0: aMonitor._toolbox.once("netmonitor-selected", () => { michael@0: michael@0: waitForNetworkEvents(aMonitor, 1).then(() => { michael@0: waitForNetworkEvents(aMonitor, 1).then(() => { michael@0: verifyRequest(1); michael@0: teardown(aMonitor).then(finish); michael@0: }); michael@0: michael@0: // Perform another batch of requests. michael@0: aDebuggee.performRequests(); michael@0: }); michael@0: michael@0: // Reload debugee. michael@0: aDebuggee.location.reload(); michael@0: }); michael@0: michael@0: // Switch back to the netmonitor. michael@0: aMonitor._toolbox.selectTool("netmonitor"); michael@0: }); michael@0: michael@0: // Switch to the webconsole. michael@0: aMonitor._toolbox.selectTool("webconsole"); michael@0: }); michael@0: michael@0: // Perform first batch of requests. michael@0: aDebuggee.performRequests(); michael@0: }); michael@0: }