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

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: fix compilation error 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
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css/css-add-rule.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css/css-add-rule.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698