Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / styles / styles-add-new-rule-tab.html
index 7f9d38a..e5c0ca5 100644 (file)
@@ -22,11 +22,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()
@@ -44,8 +40,12 @@ function test()
     function step3()
     {
         // Click "Add new rule".
-        document.getElementById("add-style-button-test-id").click();
-        InspectorTest.selectNodeAndWaitForStyles("inspected", step4);
+        InspectorTest.addNewRule(null, onRuleAdded);
+
+        function onRuleAdded()
+        {
+            InspectorTest.selectNodeAndWaitForStyles("inspected", step4);
+        }
     }
 
     function step4()