function reopenWebInspector(objectId)
{
- saveOutput();
window.didReopen = 1;
testRunner.closeWebInspector();
setTimeout(function() {
testRunner.showWebInspector();
- restoreOutput();
runTest();
}, 0);
}
function testFirstOpen()
{
InspectorTest.addResult("Dump initial styles:");
- dump(step2);
-
- function step2()
+ dump(onStylesDumped);
+
+ function onStylesDumped()
{
treeElement = InspectorTest.getMatchedStylePropertyTreeItem("color");
treeElement.startEditing();
treeElement.valueElement.textContent = "green";
treeElement.valueElement.firstChild.select();
treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
- InspectorTest.runAfterPendingDispatches(step3);
+ InspectorTest.waitForStyleApplied(onPropertyEdited);
}
- function step3()
+ function onPropertyEdited()
+ {
+ InspectorTest.addNewRule("#testDiv, my-custom-tag", onFirstRuleAdded);
+ }
+
+ function onFirstRuleAdded()
+ {
+ InspectorTest.addNewRule("#testDiv, another-custom-tag", onSecondRuleAdded);
+ }
+
+ function onSecondRuleAdded()
+ {
+ WebInspector.domModel.undo(onRuleRemoved);
+ }
+
+ function onRuleRemoved()
{
InspectorTest.selectNodeAndWaitForStyles("other", step4);
}
-
+
function step4()
{
InspectorTest.addResult("Dump styles after editing:");
function reopenInspector()
{
+ InspectorTest.flushResults();
InspectorTest.evaluateInPage("reopenWebInspector()");
}
function dump(callback)
{
InspectorTest.selectNodeAndWaitForStyles("testDiv", step2);
-
+
function step2()
{
InspectorTest.dumpSelectedElementStyles(true);