зеркало из https://github.com/mozilla/pjs.git
Bug 734043 - Error: node.parentNode is null when I click x button of thumbnail quickly in newTab page; r=dietrich
This commit is contained in:
Родитель
e6a7befda0
Коммит
af54c54e3a
|
@ -82,12 +82,17 @@ Site.prototype = {
|
|||
/**
|
||||
* Blocks the site (removes it from the grid) and calls the given callback
|
||||
* when done.
|
||||
* @param aCallback The callback to be called when finished.
|
||||
* @param aCallback The function to be called when finished.
|
||||
*/
|
||||
block: function Site_block(aCallback) {
|
||||
gBlockedLinks.block(this._link);
|
||||
gUpdater.updateGrid(aCallback);
|
||||
gPage.updateModifiedFlag();
|
||||
if (gBlockedLinks.isBlocked(this._link)) {
|
||||
if (aCallback)
|
||||
aCallback();
|
||||
} else {
|
||||
gBlockedLinks.block(this._link);
|
||||
gUpdater.updateGrid(aCallback);
|
||||
gPage.updateModifiedFlag();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,6 +23,7 @@ _BROWSER_FILES = \
|
|||
browser_newtab_bug722273.js \
|
||||
browser_newtab_bug723102.js \
|
||||
browser_newtab_bug723121.js \
|
||||
browser_newtab_bug734043.js \
|
||||
head.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function runTests() {
|
||||
setLinks("0,1,2,3,4,5,6,7,8");
|
||||
setPinnedLinks("");
|
||||
|
||||
yield addNewTabPageTab();
|
||||
|
||||
let receivedError = false;
|
||||
let block = cw.document.querySelector(".strip-button-block");
|
||||
|
||||
function onError() {
|
||||
receivedError = true;
|
||||
}
|
||||
|
||||
cw.addEventListener("error", onError);
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
EventUtils.synthesizeMouseAtCenter(block, {}, cw);
|
||||
yield executeSoon(TestRunner.next);
|
||||
}
|
||||
|
||||
yield whenPagesUpdated();
|
||||
ok(!receivedError, "we got here without any errors");
|
||||
cw.removeEventListener("error", onError);
|
||||
}
|
|
@ -265,3 +265,15 @@ function simulateDrop(aDropTarget, aDragSource) {
|
|||
if (aDragSource)
|
||||
cw.gDrag.end(aDragSource.site);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes testing when all pages have been updated.
|
||||
*/
|
||||
function whenPagesUpdated() {
|
||||
NewTabUtils.allPages.register({
|
||||
update: function () {
|
||||
NewTabUtils.allPages.unregister(this);
|
||||
executeSoon(TestRunner.next);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче