forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1304003 - Part 1: Rewrite browser_bug_865871_variables_view_close…
…_on_esc_key.js. r=bgrins MozReview-Commit-ID: DHjTBSru0uu
- Loading branch information
Showing
7 changed files
with
158 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ support-files = | |
test-console.html | ||
|
||
[browser_webconsole_init.js] | ||
[browser_webconsole_vview_close_on_esc_key.js] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...webconsole/new-console-output/test/mochitest/browser_webconsole_vview_close_on_esc_key.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ | ||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
// Check that the variables view sidebar can be closed by pressing Escape in the | ||
// web console. | ||
|
||
"use strict"; | ||
|
||
const TEST_URI = | ||
"data:text/html;charset=utf8,<script>let fooObj = {testProp: 'testValue'}</script>"; | ||
|
||
add_task(function* () { | ||
let hud = yield openNewTabAndConsole(TEST_URI); | ||
let jsterm = hud.jsterm; | ||
let vview; | ||
|
||
yield openSidebar("fooObj", 'testProp: "testValue"'); | ||
vview.window.focus(); | ||
|
||
let sidebarClosed = jsterm.once("sidebar-closed"); | ||
EventUtils.synthesizeKey("VK_ESCAPE", {}); | ||
yield sidebarClosed; | ||
|
||
function* openSidebar(objName, expectedText) { | ||
yield jsterm.execute(objName); | ||
info("JSTerm executed"); | ||
|
||
let msg = yield waitFor(() => findMessage(hud, "Object")); | ||
ok(msg, "Message found"); | ||
|
||
let anchor = msg.querySelector("a"); | ||
let body = msg.querySelector(".message-body"); | ||
ok(anchor, "object anchor"); | ||
ok(body, "message body"); | ||
ok(body.textContent.includes(expectedText), "message text check"); | ||
|
||
msg.scrollIntoView(); | ||
yield EventUtils.synthesizeMouse(anchor, 2, 2, {}, hud.iframeWindow); | ||
|
||
let vviewVar = yield jsterm.once("variablesview-fetched"); | ||
vview = vviewVar._variablesView; | ||
ok(vview, "variables view object exists"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters