Files
firefox/devtools/client/inspector/boxmodel/test/browser_boxmodel_sync.js
T
Gabriel Luong 08151dafcb Backed out 9 changesets (bug 1336198). r=backout
Backed out changeset fd85a5aafa9f (bug 1336198)
Backed out changeset e1624f6a8087 (bug 1336198)
Backed out changeset a174ae51463a (bug 1336198)
Backed out changeset a7e1c96ccf87 (bug 1336198)
Backed out changeset c0df0213c72b (bug 1336198)
Backed out changeset e7d3c4bfc729 (bug 1336198)
Backed out changeset 3c88ae1e9508 (bug 1336198)
Backed out changeset 0461bc95ee7f (bug 1336198)
Backed out changeset f6710bb42058 (bug 1336198)
2017-02-24 01:12:28 -05:00

45 lines
1.6 KiB
JavaScript

/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test editing box model syncs with the rule view.
const TEST_URI = "<p>hello</p>";
add_task(function* () {
yield addTab("data:text/html," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openBoxModelView();
info("When a property is edited, it should sync in the rule view");
yield selectNode("p", inspector);
info("Modify padding-bottom in box model view");
let span = view.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
EventUtils.synthesizeMouseAtCenter(span, {}, view.document.defaultView);
let editor = view.document.querySelector(".styleinspector-propertyeditor");
EventUtils.synthesizeKey("7", {}, view.document.defaultView);
yield waitForUpdate(inspector);
is(editor.value, "7", "Should have the right value in the editor.");
EventUtils.synthesizeKey("VK_RETURN", {}, view.document.defaultView);
let onRuleViewRefreshed = once(inspector, "rule-view-refreshed");
let onRuleViewSelected = once(inspector.sidebar, "ruleview-selected");
info("Select the rule view and check that the property was synced there");
let ruleView = selectRuleView(inspector);
info("Wait for the rule view to be selected");
yield onRuleViewSelected;
info("Wait for the rule view to be refreshed");
yield onRuleViewRefreshed;
ok(true, "The rule view was refreshed");
let ruleEditor = getRuleViewRuleEditor(ruleView, 0);
let textProp = ruleEditor.rule.textProps[0];
is(textProp.value, "7px", "The property has the right value");
});