Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: LayoutTests/http/tests/inspector/elements-test.js

Issue 441873010: DevTools: [SSP] Implement adding new rule in user stylesheet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor changes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698