Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Make sure that canceling a name change correctly unhides the separator and
6 * value elements.
7 */
9 const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
11 function test() {
12 Task.spawn(function*() {
13 let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
14 let win = panel.panelWin;
15 let vars = win.DebuggerView.Variables;
17 win.DebuggerView.WatchExpressions.addExpression("this");
19 // Allow this generator function to yield first.
20 executeSoon(() => debuggee.ermahgerd());
21 yield waitForDebuggerEvents(panel, win.EVENTS.FETCHED_WATCH_EXPRESSIONS);
23 let exprScope = vars.getScopeAtIndex(0);
24 let {target} = exprScope.get("this");
26 let name = target.querySelector(".title > .name");
27 let separator = target.querySelector(".separator");
28 let value = target.querySelector(".value");
30 is(separator.hidden, false,
31 "The separator element should not be hidden.");
32 is(value.hidden, false,
33 "The value element should not be hidden.");
35 for (let key of ["ESCAPE", "RETURN"]) {
36 EventUtils.sendMouseEvent({ type: "dblclick" }, name, win);
38 is(separator.hidden, true,
39 "The separator element should be hidden.");
40 is(value.hidden, true,
41 "The value element should be hidden.");
43 EventUtils.sendKey(key, win);
45 is(separator.hidden, false,
46 "The separator element should not be hidden.");
47 is(value.hidden, false,
48 "The value element should not be hidden.");
49 }
51 yield resumeDebuggerThenCloseAndFinish(panel);
52 });
53 }