Bug 1168246 - part2: fix tests relying on CSS suggestions order;r=pbrosset draft
authorJulian Descottes <jdescottes@mozilla.com>
Sun, 27 Mar 2016 18:24:43 +0200
changeset 345499 cbd8521b2356b976999f18ce301d8967b4ecac16
parent 345498 3317766ae63aea83f845d3cf3d134ecf60135f67
child 345500 f358ef6b795fe61eebdaee10095e1ec90411ac0c
push id14100
push userjdescottes@mozilla.com
push dateTue, 29 Mar 2016 14:09:21 +0000
reviewerspbrosset
bugs1168246
milestone48.0a1
Bug 1168246 - part2: fix tests relying on CSS suggestions order;r=pbrosset MozReview-Commit-ID: 9BEajbI665d
devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_01.js
devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_02.js
devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
--- a/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_01.js
@@ -28,36 +28,34 @@ const TEST_URL = URL_ROOT + "doc_markup_
 const TEST_DATA = [
   ["s", "s", 1, 1, false],
   ["t", "st", 2, 2, false],
   ["y", "sty", 3, 3, false],
   ["l", "styl", 4, 4, false],
   ["e", "style", 5, 5, false],
   ["=", "style=", 6, 6, false],
   ["\"", "style=\"", 7, 7, false],
-  ["d", "style=\"direction", 8, 16, true],
-  ["VK_DOWN", "style=\"display", 8, 14, true],
+  ["d", "style=\"display", 8, 14, true],
   ["VK_TAB", "style=\"display", 14, 14, true],
   ["VK_TAB", "style=\"dominant-baseline", 24, 24, true],
   ["VK_TAB", "style=\"direction", 16, 16, true],
   ["click_1", "style=\"display", 14, 14, false],
   [":", "style=\"display:-moz-box", 15, 23, true],
   ["n", "style=\"display:none", 16, 19, false],
   ["VK_BACK_SPACE", "style=\"display:n", 16, 16, false],
   ["VK_BACK_SPACE", "style=\"display:", 15, 15, false],
   [" ", "style=\"display: -moz-box", 16, 24, true],
   [" ", "style=\"display:  -moz-box", 17, 25, true],
   ["i", "style=\"display:  inherit", 18, 24, true],
   ["VK_RIGHT", "style=\"display:  inherit", 24, 24, false],
   [";", "style=\"display:  inherit;", 25, 25, false],
   [" ", "style=\"display:  inherit; ", 26, 26, false],
   [" ", "style=\"display:  inherit;  ", 27, 27, false],
   ["VK_LEFT", "style=\"display:  inherit;  ", 26, 26, false],
-  ["c", "style=\"display:  inherit; caption-side ", 27, 38, true],
-  ["o", "style=\"display:  inherit; color ", 28, 31, true],
+  ["c", "style=\"display:  inherit; color ", 27, 31, true],
   ["VK_RIGHT", "style=\"display:  inherit; color ", 31, 31, false],
   [" ", "style=\"display:  inherit; color  ", 32, 32, false],
   ["c", "style=\"display:  inherit; color c ", 33, 33, false],
   ["VK_BACK_SPACE", "style=\"display:  inherit; color  ", 32, 32, false],
   [":", "style=\"display:  inherit; color :aliceblue ", 33, 42, true],
   ["c", "style=\"display:  inherit; color :cadetblue ", 34, 42, true],
   ["VK_DOWN", "style=\"display:  inherit; color :chartreuse ", 34, 43, true],
   ["VK_RIGHT", "style=\"display:  inherit; color :chartreuse ", 43, 43, false],
--- a/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_02.js
@@ -23,18 +23,17 @@ const TEST_URL = URL_ROOT + "doc_markup_
 const TEST_DATA_DOUBLE = [
   ["s", "s", 1, 1, false],
   ["t", "st", 2, 2, false],
   ["y", "sty", 3, 3, false],
   ["l", "styl", 4, 4, false],
   ["e", "style", 5, 5, false],
   ["=", "style=", 6, 6, false],
   ["\"", "style=\"", 7, 7, false],
-  ["c", "style=\"caption-side", 8, 19, true],
-  ["o", "style=\"color", 9, 12, true],
+  ["c", "style=\"color", 8, 12, true],
   ["VK_RIGHT", "style=\"color", 12, 12, false],
   [":", "style=\"color:aliceblue", 13, 22, true],
   ["b", "style=\"color:beige", 14, 18, true],
   ["VK_RIGHT", "style=\"color:beige", 18, 18, false],
   ["\"", "style=\"color:beige\"", 19, 19, false],
   [" ", "style=\"color:beige\" ", 20, 20, false],
   ["d", "style=\"color:beige\" d", 21, 21, false],
   ["a", "style=\"color:beige\" da", 22, 22, false],
@@ -48,18 +47,17 @@ const TEST_DATA_DOUBLE = [
 const TEST_DATA_SINGLE = [
   ["s", "s", 1, 1, false],
   ["t", "st", 2, 2, false],
   ["y", "sty", 3, 3, false],
   ["l", "styl", 4, 4, false],
   ["e", "style", 5, 5, false],
   ["=", "style=", 6, 6, false],
   ["'", "style='", 7, 7, false],
-  ["c", "style='caption-side", 8, 19, true],
-  ["o", "style='color", 9, 12, true],
+  ["c", "style='color", 8, 12, true],
   ["VK_RIGHT", "style='color", 12, 12, false],
   [":", "style='color:aliceblue", 13, 22, true],
   ["b", "style='color:beige", 14, 18, true],
   ["VK_RIGHT", "style='color:beige", 18, 18, false],
   ["'", "style='color:beige'", 19, 19, false],
   [" ", "style='color:beige' ", 20, 20, false],
   ["d", "style='color:beige' d", 21, 21, false],
   ["a", "style='color:beige' da", 22, 22, false],
@@ -73,35 +71,30 @@ const TEST_DATA_SINGLE = [
 const TEST_DATA_INNER = [
   ["s", "s", 1, 1, false],
   ["t", "st", 2, 2, false],
   ["y", "sty", 3, 3, false],
   ["l", "styl", 4, 4, false],
   ["e", "style", 5, 5, false],
   ["=", "style=", 6, 6, false],
   ["\"", "style=\"", 7, 7, false],
-  ["b", "style=\"backface-visibility", 8, 26, true],
-  ["a", "style=\"backface-visibility", 9, 26, true],
-  ["c", "style=\"backface-visibility", 10, 26, true],
-  ["k", "style=\"backface-visibility", 11, 26, true],
-  ["g", "style=\"background", 12, 17, true],
+  ["b", "style=\"background", 8, 17, true],
   ["VK_RIGHT", "style=\"background", 17, 17, false],
   [":", "style=\"background:-moz-element", 18, 30, true],
   ["u", "style=\"background:unset", 19, 23, true],
   ["r", "style=\"background:url", 20, 21, false],
   ["l", "style=\"background:url", 21, 21, false],
   ["(", "style=\"background:url(", 22, 22, false],
   ["'", "style=\"background:url('", 23, 23, false],
   ["1", "style=\"background:url('1", 24, 24, false],
   ["'", "style=\"background:url('1'", 25, 25, false],
   [")", "style=\"background:url('1')", 26, 26, false],
   [";", "style=\"background:url('1');", 27, 27, false],
   [" ", "style=\"background:url('1'); ", 28, 28, false],
-  ["c", "style=\"background:url('1'); caption-side", 29, 40, true],
-  ["o", "style=\"background:url('1'); color", 30, 33, true],
+  ["c", "style=\"background:url('1'); color", 29, 33, true],
   ["VK_RIGHT", "style=\"background:url('1'); color", 33, 33, false],
   [":", "style=\"background:url('1'); color:aliceblue", 34, 43, true],
   ["b", "style=\"background:url('1'); color:beige", 35, 39, true],
   ["VK_RETURN", "style=\"background:url('1'); color:beige\"", -1, -1, false]
 ];
 
 add_task(function*() {
   info("Opening the inspector on the test URL");
--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
@@ -13,49 +13,48 @@ const MAX_ENTRIES = 10;
 //  [
 //    what key to press,
 //    expected input box value after keypress,
 //    selectedIndex of the popup,
 //    total items in the popup
 //  ]
 var testData = [
   ["VK_RIGHT", "font", -1, 0],
-  ["-", "font-family", 0, MAX_ENTRIES],
+  ["-", "font-size", 4, MAX_ENTRIES],
   ["f", "font-family", 0, 2],
   ["VK_BACK_SPACE", "font-f", -1, 0],
   ["VK_BACK_SPACE", "font-", -1, 0],
   ["VK_BACK_SPACE", "font", -1, 0],
   ["VK_BACK_SPACE", "fon", -1, 0],
   ["VK_BACK_SPACE", "fo", -1, 0],
   ["VK_BACK_SPACE", "f", -1, 0],
   ["VK_BACK_SPACE", "", -1, 0],
-  ["d", "direction", 0, 3],
-  ["VK_DOWN", "display", 1, 3],
+  ["d", "display", 1, 3],
   ["VK_DOWN", "dominant-baseline", 2, 3],
   ["VK_DOWN", "direction", 0, 3],
   ["VK_DOWN", "display", 1, 3],
   ["VK_UP", "direction", 0, 3],
   ["VK_UP", "dominant-baseline", 2, 3],
   ["VK_UP", "display", 1, 3],
   ["VK_BACK_SPACE", "d", -1, 0],
-  ["i", "direction", 0, 2],
+  ["i", "display", 1, 2],
   ["s", "display", -1, 0],
   ["VK_BACK_SPACE", "dis", -1, 0],
   ["VK_BACK_SPACE", "di", -1, 0],
   ["VK_BACK_SPACE", "d", -1, 0],
   ["VK_BACK_SPACE", "", -1, 0],
   ["VK_HOME", "", -1, 0],
   ["VK_END", "", -1, 0],
   ["VK_PAGE_UP", "", -1, 0],
   ["VK_PAGE_DOWN", "", -1, 0],
-  ["f", "fill", 0, MAX_ENTRIES],
-  ["i", "fill", 0, 4],
-  ["VK_LEFT", "fill", -1, 0],
-  ["VK_LEFT", "fill", -1, 0],
-  ["i", "fiill", -1, 0],
+  ["f", "filter", 3, MAX_ENTRIES],
+  ["i", "filter", 3, 4],
+  ["VK_LEFT", "filter", -1, 0],
+  ["VK_LEFT", "filter", -1, 0],
+  ["i", "fiilter", -1, 0],
   ["VK_ESCAPE", null, -1, 0],
 ];
 
 const TEST_URI = "<h1 style='font: 24px serif'>Header</h1>";
 
 add_task(function*() {
   yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
   let {toolbox, inspector, view, testActor} = yield openRuleView();
--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
@@ -24,19 +24,17 @@ var testData = [
   ["VK_RIGHT", {}, "blue", -1, 0, false],
   [" ", {}, "blue !important", 0, 10, true],
   ["!", {}, "blue !important", 0, 0, true],
   ["VK_BACK_SPACE", {}, "blue !", -1, 0, true],
   ["VK_BACK_SPACE", {}, "blue ", -1, 0, true],
   ["VK_BACK_SPACE", {}, "blue", -1, 0, true],
   ["VK_TAB", {shiftKey: true}, "color", -1, 0, true],
   ["VK_BACK_SPACE", {}, "", -1, 0, false],
-  ["d", {}, "direction", 0, 3, false],
-  ["i", {}, "direction", 0, 2, false],
-  ["s", {}, "display", -1, 0, false],
+  ["d", {}, "display", 1, 3, false],
   ["VK_TAB", {}, "blue", -1, 0, true],
   ["n", {}, "none", -1, 0, true],
   ["VK_RETURN", {}, null, -1, 0, true]
 ];
 
 const TEST_URI = "<h1 style='color: red'>Header</h1>";
 
 add_task(function*() {
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
@@ -12,33 +12,32 @@ const MAX_ENTRIES = 10;
 // format :
 //  [
 //    what key to press,
 //    expected input box value after keypress,
 //    selectedIndex of the popup,
 //    total items in the popup
 //  ]
 var testData = [
-  ["d", "direction", 0, 3],
-  ["VK_DOWN", "display", 1, 3],
+  ["d", "display", 1, 3],
   ["VK_DOWN", "dominant-baseline", 2, 3],
   ["VK_DOWN", "direction", 0, 3],
   ["VK_DOWN", "display", 1, 3],
   ["VK_UP", "direction", 0, 3],
   ["VK_UP", "dominant-baseline", 2, 3],
   ["VK_UP", "display", 1, 3],
   ["VK_BACK_SPACE", "d", -1, 0],
-  ["i", "direction", 0, 2],
+  ["i", "display", 1, 2],
   ["s", "display", -1, 0],
   ["VK_BACK_SPACE", "dis", -1, 0],
   ["VK_BACK_SPACE", "di", -1, 0],
   ["VK_BACK_SPACE", "d", -1, 0],
   ["VK_BACK_SPACE", "", -1, 0],
-  ["f", "fill", 0, MAX_ENTRIES],
-  ["i", "fill", 0, 4],
+  ["f", "filter", 3, MAX_ENTRIES],
+  ["i", "filter", 3, 4],
   ["VK_ESCAPE", null, -1, 0],
 ];
 
 const TEST_URI = "<h1 style='border: 1px solid red'>Header</h1>";
 
 add_task(function*() {
   yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
   let {toolbox, inspector, view, testActor} = yield openRuleView();
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
@@ -12,24 +12,23 @@
 //    what key to press,
 //    modifers,
 //    expected input box value after keypress,
 //    selectedIndex of the popup,
 //    total items in the popup,
 //    expect ruleview-changed
 //  ]
 var testData = [
-  ["d", {}, "direction", 0, 3, false],
-  ["VK_DOWN", {}, "display", 1, 3, false],
+  ["d", {}, "display", 1, 3, false],
   ["VK_TAB", {}, "", -1, 10, true],
   ["VK_DOWN", {}, "-moz-box", 0, 10, true],
   ["n", {}, "none", -1, 0, true],
   ["VK_TAB", {shiftKey: true}, "display", -1, 0, true],
   ["VK_BACK_SPACE", {}, "", -1, 0, false],
-  ["c", {}, "caption-side", 0, 10, false],
+  ["c", {}, "color", 5, 10, false],
   ["o", {}, "color", 0, 7, false],
   ["VK_TAB", {}, "none", -1, 0, true],
   ["r", {}, "rebeccapurple", 0, 6, true],
   ["VK_DOWN", {}, "red", 1, 6, true],
   ["VK_DOWN", {}, "rgb", 2, 6, true],
   ["VK_DOWN", {}, "rgba", 3, 6, true],
   ["VK_DOWN", {}, "rosybrown", 4, 6, true],
   ["VK_DOWN", {}, "royalblue", 5, 6, true],