| Index: third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html
|
| index 2285cb2fed5de512d2bb1816a2b9421e9a56a009..68324e453a4641180baca2c89af0c18884c976f3 100644
|
| --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html
|
| +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html
|
| @@ -7,24 +7,18 @@
|
|
|
| function test()
|
| {
|
| - var inspectorResource;
|
| + InspectorTest.selectNodeAndWaitForStyles("inspected", onStylesSelected);
|
|
|
| - InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
|
| -
|
| - function step1(node)
|
| + function onStylesSelected(node)
|
| {
|
| - InspectorTest.addNewRule("#inspected", stylesReceived);
|
| -
|
| - function stylesReceived()
|
| - {
|
| - // UISourceCode.prototype.addRevision() must finish before step2 is called.
|
| - InspectorTest.showScriptSource("inspector-stylesheet", step2);
|
| - }
|
| + WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyCommitted, onWorkingCopyCommitted);
|
| + InspectorTest.addNewRule("#inspected", new Function());
|
| }
|
|
|
| - function step2(sourceFrame)
|
| + function onWorkingCopyCommitted(event)
|
| {
|
| - var uiSourceCode = sourceFrame._uiSourceCode;
|
| + WebInspector.workspace.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, onWorkingCopyCommitted);
|
| + var uiSourceCode = event.data.uiSourceCode;
|
| InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.displayName());
|
| uiSourceCode.requestContent().then(printContent(onContent))
|
|
|
| @@ -33,11 +27,11 @@ function test()
|
| InspectorTest.addResult("\nSetting new content");
|
| uiSourceCode.setWorkingCopy("#inspected { background-color: green; }");
|
| uiSourceCode.commitWorkingCopy();
|
| - step3(uiSourceCode);
|
| + onUpdatedWorkingCopy(uiSourceCode);
|
| }
|
| }
|
|
|
| - function step3(uiSourceCode)
|
| + function onUpdatedWorkingCopy(uiSourceCode)
|
| {
|
| uiSourceCode.requestContent().then(printContent(selectNode));
|
| function selectNode()
|
|
|