Bug 1000716 - Intermittent race condition in markupview/test/browser_markupview_mutation_02.js. r=miker

This commit is contained in:
Patrick Brosset 2014-08-11 04:43:00 -04:00
parent ab7eacb8d8
commit 2e9dede6bb
2 changed files with 15 additions and 2 deletions

View File

@ -13,7 +13,6 @@ const DEFAULT_MAX_CHILDREN = 100;
const COLLAPSE_ATTRIBUTE_LENGTH = 120;
const COLLAPSE_DATA_URL_REGEX = /^data.+base64/;
const COLLAPSE_DATA_URL_LENGTH = 60;
const CONTAINER_FLASHING_DURATION = 500;
const NEW_SELECTION_HIGHLIGHTER_TIMER = 1000;
const {UndoStack} = require("devtools/shared/undo");
@ -112,6 +111,11 @@ function MarkupView(aInspector, aFrame, aControllerWindow) {
exports.MarkupView = MarkupView;
MarkupView.prototype = {
/**
* How long does a node flash when it mutates (in ms).
*/
CONTAINER_FLASHING_DURATION: 500,
_selectedContainer: null,
_initTooltips: function() {
@ -1578,7 +1582,7 @@ MarkupContainer.prototype = {
}
this._flashMutationTimer = contentWin.setTimeout(() => {
this.flashed = false;
}, CONTAINER_FLASHING_DURATION);
}, this.markup.CONTAINER_FLASHING_DURATION);
}
},

View File

@ -55,6 +55,10 @@ const TEST_DATA = [{
let test = asyncTest(function*() {
let {inspector} = yield addTab(TEST_URL).then(openInspector);
// Make sure mutated nodes flash for a very long time so we can more easily
// assert they do
inspector.markup.CONTAINER_FLASHING_DURATION = 1000 * 60 * 60;
info("Getting the <ul.list> root node to test mutations on");
let rootNode = getNode(".list");
let rootNodeFront = yield getNodeFront(".list", inspector);
@ -88,4 +92,9 @@ function* assertNodeFlashing(nodeFront, inspector) {
ok(container, "Markup container for node found");
ok(container.tagState.classList.contains("theme-bg-contrast"),
"Markup container for node is flashing");
// Clear the mutation flashing timeout now that we checked the node was flashing
let markup = inspector.markup;
markup._frame.contentWindow.clearTimeout(container._flashMutationTimer);
container._flashMutationTimer = null;
}