browser/devtools/styleinspector/test/browser_ruleview_multiple-properties-duplicates.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
     2 /* Any copyright is dedicated to the Public Domain.
     3  http://creativecommons.org/publicdomain/zero/1.0/ */
     5 "use strict";
     7 // Test that the rule-view behaves correctly when entering mutliple and/or
     8 // unfinished properties/values in inplace-editors
    10 let test = asyncTest(function*() {
    11   yield addTab("data:text/html,test rule view user changes");
    12   content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
    13   let {toolbox, inspector, view} = yield openRuleView();
    15   info("Creating the test element");
    16   let newElement = content.document.createElement("div");
    17   newElement.textContent = "Test Element";
    18   content.document.body.appendChild(newElement);
    19   yield selectNode(newElement, inspector);
    20   let ruleEditor = view.element.children[0]._ruleEditor;
    22   yield testCreateNewMultiDuplicates(inspector, ruleEditor);
    23 });
    25 function* testCreateNewMultiDuplicates(inspector, ruleEditor) {
    26   yield createNewRuleViewProperty(ruleEditor,
    27     "color:red;color:orange;color:yellow;color:green;color:blue;color:indigo;color:violet;");
    29   is(ruleEditor.rule.textProps.length, 7, "Should have created new text properties.");
    30   is(ruleEditor.propertyList.children.length, 8, "Should have created new property editors.");
    32   is(ruleEditor.rule.textProps[0].name, "color", "Should have correct property name");
    33   is(ruleEditor.rule.textProps[0].value, "red", "Should have correct property value");
    35   is(ruleEditor.rule.textProps[1].name, "color", "Should have correct property name");
    36   is(ruleEditor.rule.textProps[1].value, "orange", "Should have correct property value");
    38   is(ruleEditor.rule.textProps[2].name, "color", "Should have correct property name");
    39   is(ruleEditor.rule.textProps[2].value, "yellow", "Should have correct property value");
    41   is(ruleEditor.rule.textProps[3].name, "color", "Should have correct property name");
    42   is(ruleEditor.rule.textProps[3].value, "green", "Should have correct property value");
    44   is(ruleEditor.rule.textProps[4].name, "color", "Should have correct property name");
    45   is(ruleEditor.rule.textProps[4].value, "blue", "Should have correct property value");
    47   is(ruleEditor.rule.textProps[5].name, "color", "Should have correct property name");
    48   is(ruleEditor.rule.textProps[5].value, "indigo", "Should have correct property value");
    50   is(ruleEditor.rule.textProps[6].name, "color", "Should have correct property name");
    51   is(ruleEditor.rule.textProps[6].value, "violet", "Should have correct property value");
    53   yield inspector.once("inspector-updated");
    54 }

mercurial