зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1161072 - Fix pending requests in markup view tests. r=pbrosset
This commit is contained in:
Родитель
313ec41bae
Коммит
b8bdee0297
|
@ -30,6 +30,7 @@ const Heritage = require("sdk/core/heritage");
|
||||||
const {setTimeout, clearTimeout, setInterval, clearInterval} = require("sdk/timers");
|
const {setTimeout, clearTimeout, setInterval, clearInterval} = require("sdk/timers");
|
||||||
const {parseAttribute} = require("devtools/shared/node-attribute-parser");
|
const {parseAttribute} = require("devtools/shared/node-attribute-parser");
|
||||||
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
|
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
|
||||||
|
const {Task} = require("resource://gre/modules/Task.jsm");
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/devtools/LayoutHelpers.jsm");
|
Cu.import("resource://gre/modules/devtools/LayoutHelpers.jsm");
|
||||||
Cu.import("resource://gre/modules/devtools/Templater.jsm");
|
Cu.import("resource://gre/modules/devtools/Templater.jsm");
|
||||||
|
@ -1955,7 +1956,7 @@ MarkupContainer.prototype = {
|
||||||
/**
|
/**
|
||||||
* On mouse up, stop dragging.
|
* On mouse up, stop dragging.
|
||||||
*/
|
*/
|
||||||
_onMouseUp: function(event) {
|
_onMouseUp: Task.async(function*() {
|
||||||
this._isMouseDown = false;
|
this._isMouseDown = false;
|
||||||
|
|
||||||
if (!this.isDragging) {
|
if (!this.isDragging) {
|
||||||
|
@ -1967,13 +1968,14 @@ MarkupContainer.prototype = {
|
||||||
|
|
||||||
let dropTargetNodes = this.markup.dropTargetNodes;
|
let dropTargetNodes = this.markup.dropTargetNodes;
|
||||||
|
|
||||||
if(!dropTargetNodes) {
|
if (!dropTargetNodes) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.markup.walker.insertBefore(this.node, dropTargetNodes.parent,
|
yield this.markup.walker.insertBefore(this.node, dropTargetNodes.parent,
|
||||||
dropTargetNodes.nextSibling);
|
dropTargetNodes.nextSibling);
|
||||||
},
|
this.markup.emit("drop-completed");
|
||||||
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On mouse move, move the dragged element if any and indicate the drop target.
|
* On mouse move, move the dragged element if any and indicate the drop target.
|
||||||
|
|
|
@ -46,9 +46,13 @@ add_task(function*() {
|
||||||
|
|
||||||
yield scroll;
|
yield scroll;
|
||||||
|
|
||||||
|
let dropCompleted = once(markup, "drop-completed");
|
||||||
|
|
||||||
container._onMouseUp(ev);
|
container._onMouseUp(ev);
|
||||||
markup._onMouseUp(ev);
|
markup._onMouseUp(ev);
|
||||||
|
|
||||||
|
yield dropCompleted;
|
||||||
|
|
||||||
ok("Scroll event fired");
|
ok("Scroll event fired");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,4 +62,4 @@ function onScroll(win) {
|
||||||
resolve(e);
|
resolve(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,6 +31,8 @@ add_task(function*() {
|
||||||
yield wait(GRAB_DELAY + 1);
|
yield wait(GRAB_DELAY + 1);
|
||||||
ok(el.isDragging, "isDragging true after GRAB_DELAY has passed");
|
ok(el.isDragging, "isDragging true after GRAB_DELAY has passed");
|
||||||
|
|
||||||
|
let dropCompleted = once(inspector.markup, "drop-completed");
|
||||||
|
|
||||||
info("Simulating mouseUp on #test");
|
info("Simulating mouseUp on #test");
|
||||||
el._onMouseUp({
|
el._onMouseUp({
|
||||||
target: el.tagLine,
|
target: el.tagLine,
|
||||||
|
@ -38,5 +40,7 @@ add_task(function*() {
|
||||||
pageY: rect.y
|
pageY: rect.y
|
||||||
});
|
});
|
||||||
|
|
||||||
|
yield dropCompleted;
|
||||||
|
|
||||||
is(el.isDragging, false, "isDragging false after mouseUp");
|
is(el.isDragging, false, "isDragging false after mouseUp");
|
||||||
});
|
});
|
||||||
|
|
Загрузка…
Ссылка в новой задаче