forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show PaintWorkletGlobalScope in dev-tool's console list
Currently, if we open a webpage that calls registerPaint API and open the dev-tool, we would see "top" under the console list. The reason is that when the MainThreadDebugger::ContextCreated is called, the |human_readable_name| is set to an empty string. This CL changes it such that when the InitializeContextIfNeeded is called from PaintWorkletGlobalScope::Create, we pass a string to set the |human_readable_name| when it is not the main world, and that string will show up in the dev-tool's console list. Bug: 728591 Change-Id: I588d40c03d670331fdabee456411c34f75a7fb02 Reviewed-on: https://chromium-review.googlesource.com/543616 Commit-Queue: Xida Chen <xidachen@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#483286}
- Loading branch information
Showing
12 changed files
with
81 additions
and
20 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
third_party/WebKit/LayoutTests/inspector/console/paintworklet-console-selector-expected.txt
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,6 @@ | ||
Tests console execution context selector for paintworklet. | ||
|
||
Console context selector: | ||
* top | ||
____Paint Worklet | ||
|
39 changes: 39 additions & 0 deletions
39
third_party/WebKit/LayoutTests/inspector/console/paintworklet-console-selector.html
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,39 @@ | ||
<html> | ||
<head> | ||
<script src="../../http/tests/inspector/inspector-test.js"></script> | ||
<script src="../../http/tests/inspector/console-test.js"></script> | ||
<script src="../../http/tests/inspector/debugger-test.js"></script> | ||
|
||
<script id="code" type="text/worklet"> | ||
registerPaint('foo', class { paint() { } }); | ||
</script> | ||
<script> | ||
function setup() { | ||
var blob = new Blob([code.textContent], {type: 'text/javascript'}); | ||
return paintWorklet.addModule(URL.createObjectURL(blob)); | ||
} | ||
|
||
async function test() | ||
{ | ||
await new Promise(f => InspectorTest.startDebuggerTest(f, true)); | ||
await InspectorTest.evaluateInPageAsync('setup()'); | ||
|
||
var consoleView = Console.ConsoleView.instance(); | ||
var selector = consoleView._consoleContextSelector; | ||
InspectorTest.addResult('Console context selector:'); | ||
for (var executionContext of selector._items) { | ||
var selected = UI.context.flavor(SDK.ExecutionContext) === executionContext; | ||
var text = '____'.repeat(selector._depthFor(executionContext)) + selector.titleFor(executionContext); | ||
var disabled = !selector.isItemSelectable(executionContext); | ||
InspectorTest.addResult(`${selected ? '*' : ' '} ${text} ${disabled ? '[disabled]' : ''}`); | ||
} | ||
|
||
InspectorTest.completeDebuggerTest(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="runTest()"> | ||
<p> Tests console execution context selector for paintworklet. | ||
</p> | ||
</body> | ||
</html> |
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
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
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