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

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

Issue 2916283002: Revert 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 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();
}

Powered by Google App Engine
This is Rietveld 408576698