Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / styles / styles-add-new-rule-colon.html
index b17e017..e71ac1d 100644 (file)
@@ -12,7 +12,6 @@ function test()
         return;
     }
 
-    WebInspector.inspectorView.showPanel("elements");
     InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
     InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", revisionAdded);
 
@@ -21,12 +20,7 @@ function test()
 
     function step1()
     {
-        // Click "Add new rule".
-        document.getElementById("add-style-button-test-id").click();
-        var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
-        section._selectorElement.textContent = "foo, " + section._selectorElement.textContent + ", bar";
-        section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
-        InspectorTest.runAfterPendingDispatches(step2);
+        InspectorTest.addNewRule("foo, div#inspected, bar", step2);
     }
 
     function step2()
@@ -37,8 +31,8 @@ function test()
         textInputController.insertText("color");
         eventSender.keyDown(":");
         textInputController.insertText("maroon");
+        InspectorTest.waitForStyleApplied(step3);
         eventSender.keyDown(";");
-        InspectorTest.runAfterPendingDispatches(step3);
     }
 
     function step3() {
@@ -47,9 +41,12 @@ function test()
 
     function step4()
     {
-        // Click "Add new rule".
-        document.getElementById("add-style-button-test-id").click();
-        InspectorTest.selectNodeAndWaitForStyles("inspected", step5);
+        InspectorTest.addNewRule(null, onRuleAdded);
+
+        function onRuleAdded()
+        {
+            InspectorTest.selectNodeAndWaitForStyles("inspected", step5);
+        }
     }
 
     function step5()