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 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
4 */
6 // Test the webconsole output for DOM events.
8 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-events.html";
10 function test() {
11 addTab(TEST_URI);
12 browser.addEventListener("load", function onLoad() {
13 browser.removeEventListener("load", onLoad, true);
14 Task.spawn(runner);
15 }, true);
17 function* runner()
18 {
19 let hud = yield openConsole();
21 hud.jsterm.clearOutput();
22 hud.jsterm.execute("testDOMEvents()");
24 yield waitForMessages({
25 webconsole: hud,
26 messages: [{
27 name: "testDOMEvents() output",
28 text: "undefined",
29 category: CATEGORY_OUTPUT,
30 }],
31 });
33 EventUtils.synthesizeMouse(content.document.body, 2, 2, {type: "mousemove"}, content);
35 yield waitForMessages({
36 webconsole: hud,
37 messages: [{
38 name: "console.log() output for mousemove",
39 text: /"eventLogger" mousemove { target: .+, buttons: 1, clientX: \d+, clientY: \d+, layerX: \d+, layerY: \d+ }/,
40 category: CATEGORY_WEBDEV,
41 severity: SEVERITY_LOG,
42 }],
43 });
45 content.focus();
46 EventUtils.synthesizeKey("a", {shiftKey: true}, content);
48 yield waitForMessages({
49 webconsole: hud,
50 messages: [{
51 name: "console.log() output for keypress",
52 text: /"eventLogger" keypress Shift { target: .+, key: .+, charCode: \d+, keyCode: \d+ }/,
53 category: CATEGORY_WEBDEV,
54 severity: SEVERITY_LOG,
55 }],
56 });
58 finishTest();
59 }
60 }