michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 462459; michael@0: var summary = 'TM: trace new Array(1)'; michael@0: var actual = ''; michael@0: var expect = ''; michael@0: michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: jit(true); michael@0: michael@0: if (!this.tracemonkey || this.tracemonkey.adaptive) michael@0: { michael@0: jit(false); michael@0: expect = actual = 'Test skipped due to lack of tracemonkey jitstats'; michael@0: reportCompare(expect, actual, summary); michael@0: } michael@0: else michael@0: { michael@0: jit(true); michael@0: michael@0: expect = 'recorder started, recorder not aborted, trace completed'; michael@0: actual = ''; michael@0: michael@0: var recorderStartedStart = this.tracemonkey.recorderStarted; michael@0: var recorderAbortedStart = this.tracemonkey.recorderAborted; michael@0: var traceCompletedStart = this.tracemonkey.traceCompleted; michael@0: michael@0: michael@0: for (var i = 0; i < RUNLOOP; i++) michael@0: { michael@0: new Array(1); michael@0: } michael@0: michael@0: jit(false); michael@0: michael@0: var recorderStartedEnd = this.tracemonkey.recorderStarted; michael@0: var recorderAbortedEnd = this.tracemonkey.recorderAborted; michael@0: var traceCompletedEnd = this.tracemonkey.traceCompleted; michael@0: michael@0: if (recorderStartedEnd > recorderStartedStart) michael@0: { michael@0: actual = 'recorder started, '; michael@0: } michael@0: else michael@0: { michael@0: actual = 'recorder not started, '; michael@0: } michael@0: michael@0: if (recorderAbortedEnd > recorderAbortedStart) michael@0: { michael@0: actual += 'recorder aborted, '; michael@0: } michael@0: else michael@0: { michael@0: actual += 'recorder not aborted, '; michael@0: } michael@0: michael@0: if (traceCompletedEnd > traceCompletedStart) michael@0: { michael@0: actual += 'trace completed'; michael@0: } michael@0: else michael@0: { michael@0: actual += 'trace not completed'; michael@0: } michael@0: michael@0: reportCompare(expect, actual, summary); michael@0: } michael@0: