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 opening the variable inspection popup on a variable which has a michael@0: * a property accessible via getters and setters. michael@0: */ michael@0: michael@0: const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html"; michael@0: michael@0: function test() { michael@0: Task.spawn(function() { michael@0: let [tab, debuggee, panel] = yield initDebugger(TAB_URL); michael@0: let win = panel.panelWin; michael@0: let bubble = win.DebuggerView.VariableBubble; michael@0: let tooltip = bubble._tooltip.panel; michael@0: michael@0: function verifyContents(textContent, className) { michael@0: is(tooltip.querySelectorAll(".variables-view-container").length, 0, michael@0: "There should be no variables view containers added to the tooltip."); michael@0: is(tooltip.querySelectorAll(".devtools-tooltip-simple-text").length, 1, michael@0: "There should be a simple text node added to the tooltip instead."); michael@0: michael@0: is(tooltip.querySelector(".devtools-tooltip-simple-text").textContent, textContent, michael@0: "The inspected property's value is correct."); michael@0: ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.contains(className), michael@0: "The inspected property's value is colorized correctly."); michael@0: } michael@0: michael@0: // Allow this generator function to yield first. michael@0: executeSoon(() => debuggee.start()); michael@0: yield waitForSourceAndCaretAndScopes(panel, ".html", 24); michael@0: michael@0: // Inspect properties. michael@0: yield openVarPopup(panel, { line: 19, ch: 10 }); michael@0: verifyContents("42", "token-number"); michael@0: michael@0: yield reopenVarPopup(panel, { line: 20, ch: 14 }); michael@0: verifyContents("42", "token-number"); michael@0: michael@0: yield reopenVarPopup(panel, { line: 21, ch: 14 }); michael@0: verifyContents("42", "token-number"); michael@0: michael@0: yield resumeDebuggerThenCloseAndFinish(panel); michael@0: }); michael@0: }