Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html

Issue 2919123002: Reland of DevTools: require enabling CSS domain before running CSS.* commands. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html b/third_party/WebKit/LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html
index 44e89207153209f5c0de654b3977cfd83f33b094..9667efb4ade6f78ad2db38d0550b0f978b5e96bb 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html
@@ -9,47 +9,29 @@
InspectorTest.sendCommand("CSS.enable", {}, cssWasEnabled);
- function cssWasEnabled()
+ async function cssWasEnabled()
{
- InspectorTest.sendCommandOrDie("DOM.getDocument", {}, onGotDocument);
- }
-
- function onGotDocument(result)
- {
+ var result = await InspectorTest.sendCommandOrDie("DOM.getDocument", {});
var root = result.root;
- InspectorTest.sendCommandOrDie("DOM.querySelector", {
+ var node = await InspectorTest.sendCommandOrDie("DOM.querySelector", {
nodeId: root.nodeId,
selector: "#inliner"
- }, onGotNode);
- }
+ });
- function onGotNode(node)
- {
- InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", { nodeId: node.nodeId }, onGotInlineStyles);
- }
+ await InspectorTest.sendCommandOrDie("CSS.enable", { });
- function onGotInlineStyles(result)
- {
+ result = await InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", { nodeId: node.nodeId });
inlineStyleSheetId = result.inlineStyle.styleSheetId;
- InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onReceiveStyleSheetText);
- }
- function onReceiveStyleSheetText(result)
- {
+ result = await InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId });
InspectorTest.log(result.text);
- InspectorTest.sendCommandOrDie("CSS.setStyleSheetText", {
+
+ result = await InspectorTest.sendCommandOrDie("CSS.setStyleSheetText", {
styleSheetId: inlineStyleSheetId,
text: "border: 1px solid black;"
- }, onSetStyleSheetBody);
- }
+ });
- function onSetStyleSheetBody(result)
- {
- InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onCheckStyleSheetBody);
- }
-
- function onCheckStyleSheetBody(result)
- {
+ result = await InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId });
InspectorTest.log(result.text);
InspectorTest.completeTest();
}

Powered by Google App Engine
This is Rietveld 408576698