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: * Tests if certain function calls are properly highlighted in the UI. michael@0: */ michael@0: michael@0: function ifTestingSupported() { michael@0: let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); michael@0: let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin; michael@0: michael@0: yield reload(target); michael@0: michael@0: let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: yield promise.all([recordingFinished, callListPopulated]); michael@0: michael@0: is(CallsListView.itemCount, 8, michael@0: "All the function calls should now be displayed in the UI."); michael@0: michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(0).target).hasAttribute("draw-call"), true, michael@0: "The first item's node should have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(1).target).hasAttribute("draw-call"), false, michael@0: "The second item's node should not have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(2).target).hasAttribute("draw-call"), true, michael@0: "The third item's node should have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(3).target).hasAttribute("draw-call"), false, michael@0: "The fourth item's node should not have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(4).target).hasAttribute("draw-call"), true, michael@0: "The fifth item's node should have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(5).target).hasAttribute("draw-call"), false, michael@0: "The sixth item's node should not have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(6).target).hasAttribute("draw-call"), true, michael@0: "The seventh item's node should have a draw-call attribute."); michael@0: is($(".call-item-view", CallsListView.getItemAtIndex(7).target).hasAttribute("draw-call"), false, michael@0: "The eigth item's node should not have a draw-call attribute."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }