This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1593933 - [devtools] Navigating should close existing console.gro…
…up messages. r=nchevobbe When a navigation message is added into the store, reset the currentGroup property This adds a test to ensure the fix works as expected. Differential Revision: https://phabricator.services.mozilla.com/D92778
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
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
29 changes: 29 additions & 0 deletions
29
devtools/client/webconsole/test/browser/browser_webconsole_close_groups_after_navigation.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,29 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
const TEST_URI = `data:text/html;charset=utf8,<script>console.group('hello')</script>`; | ||
|
||
add_task(async function() { | ||
// Enable persist logs | ||
await pushPref("devtools.webconsole.persistlog", true); | ||
|
||
const hud = await openNewTabAndConsole(TEST_URI); | ||
|
||
info("Refresh tab several times and check for correct message indentation"); | ||
for (let i = 0; i < 5; i++) { | ||
await refreshTabAndCheckIndent(hud); | ||
} | ||
}); | ||
|
||
async function refreshTabAndCheckIndent(hud) { | ||
const onMessage = waitForMessage(hud, "hello"); | ||
await refreshTab(); | ||
const { node } = await onMessage; | ||
|
||
is( | ||
node.querySelector(".indent").getAttribute("data-indent"), | ||
"0", | ||
"The message has the expected indent" | ||
); | ||
} |