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 9667efb4ade6f78ad2db38d0550b0f978b5e96bb..44e89207153209f5c0de654b3977cfd83f33b094 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,29 +9,47 @@ |
InspectorTest.sendCommand("CSS.enable", {}, cssWasEnabled); |
- async function cssWasEnabled() |
+ function cssWasEnabled() |
{ |
- var result = await InspectorTest.sendCommandOrDie("DOM.getDocument", {}); |
+ InspectorTest.sendCommandOrDie("DOM.getDocument", {}, onGotDocument); |
+ } |
+ |
+ function onGotDocument(result) |
+ { |
var root = result.root; |
- var node = await InspectorTest.sendCommandOrDie("DOM.querySelector", { |
+ InspectorTest.sendCommandOrDie("DOM.querySelector", { |
nodeId: root.nodeId, |
selector: "#inliner" |
- }); |
+ }, onGotNode); |
+ } |
- await InspectorTest.sendCommandOrDie("CSS.enable", { }); |
+ function onGotNode(node) |
+ { |
+ InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", { nodeId: node.nodeId }, onGotInlineStyles); |
+ } |
- result = await InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", { nodeId: node.nodeId }); |
+ function onGotInlineStyles(result) |
+ { |
inlineStyleSheetId = result.inlineStyle.styleSheetId; |
+ InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onReceiveStyleSheetText); |
+ } |
- result = await InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }); |
+ function onReceiveStyleSheetText(result) |
+ { |
InspectorTest.log(result.text); |
- |
- result = await InspectorTest.sendCommandOrDie("CSS.setStyleSheetText", { |
+ InspectorTest.sendCommandOrDie("CSS.setStyleSheetText", { |
styleSheetId: inlineStyleSheetId, |
text: "border: 1px solid black;" |
- }); |
+ }, onSetStyleSheetBody); |
+ } |
- result = await InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }); |
+ function onSetStyleSheetBody(result) |
+ { |
+ InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onCheckStyleSheetBody); |
+ } |
+ |
+ function onCheckStyleSheetBody(result) |
+ { |
InspectorTest.log(result.text); |
InspectorTest.completeTest(); |
} |