Bug 1237885 - Remove duplicated addNewRule code from ruleview tests; r=jdescottes
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 30 May 2016 12:04:31 +0200
changeset 340524 5b09865bf213b1bc7ec2bca83a4c17a96f1b82bf
parent 340523 5650575837d9cfd1787008a938b11ce75ba515f4
child 340525 c559eed248f226348cb750309fb326507cd0764b
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1237885
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1237885 - Remove duplicated addNewRule code from ruleview tests; r=jdescottes MozReview-Commit-ID: HqUaFFWiTym
devtools/client/inspector/rules/test/browser_rules_add-rule_iframes.js
devtools/client/inspector/rules/test/browser_rules_add-rule_pseudo_class.js
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_iframes.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_iframes.js
@@ -29,24 +29,16 @@ add_task(function* () {
 
   let innerFrameDiv2 = yield getNodeFrontInFrame("div", "#frame2", inspector);
   yield selectNode(innerFrameDiv2, inspector);
   yield addNewRule(inspector, view);
   yield testNewRule(view, "div", 1);
   yield addNewProperty(view, 1, "color", "green");
 });
 
-function* addNewRule(inspector, view) {
-  info("Adding the new rule using the button");
-  view.addRuleButton.click();
-  info("Waiting for rule view to change");
-  let onRuleViewChanged = once(view, "ruleview-changed");
-  yield onRuleViewChanged;
-}
-
 /**
  * Check the newly created rule has the expected selector and submit the
  * selector editor.
  */
 function* testNewRule(view, expected, index) {
   let idRuleEditor = getRuleViewRuleEditor(view, index);
   let editor = idRuleEditor.selectorText.ownerDocument.activeElement;
   is(editor.value, expected,
--- a/devtools/client/inspector/rules/test/browser_rules_add-rule_pseudo_class.js
+++ b/devtools/client/inspector/rules/test/browser_rules_add-rule_pseudo_class.js
@@ -31,24 +31,16 @@ add_task(function* () {
 
 function* runTestData(inspector, view, pseudoClasses) {
   yield setPseudoLocks(inspector, view, pseudoClasses);
   yield addNewRule(inspector, view);
   yield testNewRule(view, pseudoClasses, 1);
   yield resetPseudoLocks(inspector, view);
 }
 
-function* addNewRule(inspector, view) {
-  info("Adding the new rule using the button");
-  view.addRuleButton.click();
-  info("Waiting for rule view to change");
-  let onRuleViewChanged = once(view, "ruleview-changed");
-  yield onRuleViewChanged;
-}
-
 function* testNewRule(view, pseudoClasses, index) {
   let idRuleEditor = getRuleViewRuleEditor(view, index);
   let editor = idRuleEditor.selectorText.ownerDocument.activeElement;
   let expected = EXPECTED_SELECTOR + pseudoClasses.join("");
 
   is(editor.value, expected,
       "Selector editor value is as expected: " + expected);