Index: LayoutTests/http/tests/inspector/elements-test.js |
diff --git a/LayoutTests/http/tests/inspector/elements-test.js b/LayoutTests/http/tests/inspector/elements-test.js |
index 1a969179c196feead1957add3bca67a962b7eca9..c2a5b3865ab3fbfdde20231b5d9115cee19c0ca8 100644 |
--- a/LayoutTests/http/tests/inspector/elements-test.js |
+++ b/LayoutTests/http/tests/inspector/elements-test.js |
@@ -728,11 +728,16 @@ InspectorTest.addNewRule = function(selector, callback) |
{ |
// Click "Add new rule". |
document.getElementById("add-style-button-test-id").click(); |
- var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2]; |
- if (typeof selector === "string") |
- section._selectorElement.textContent = selector; |
- section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); |
- InspectorTest.runAfterPendingDispatches(callback.bind(null, section)); |
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection); |
+ |
+ function onBlankSection() |
+ { |
+ var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2]; |
+ if (typeof selector === "string") |
+ section._selectorElement.textContent = selector; |
+ section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); |
+ InspectorTest.runAfterPendingDispatches(callback.bind(null, section)); |
+ } |
} |
InspectorTest.dumpInspectorHighlight = function(node, callback) |