Bug 1126184: Part 3: Mochitest fixes for suggested tiles. r=adw

This commit is contained in:
Marina Samuel 2015-03-10 17:33:28 -04:00
parent 0ea5074cf7
commit 79ca0f15ef
3 changed files with 9 additions and 1 deletions

View File

@ -31,4 +31,6 @@ function runTests() {
NewTabUtils.allPages.enabled = true;
ok(!gridNode.hasAttribute("page-disabled"), "page is not disabled");
ok(!oldGridNode.hasAttribute("page-disabled"), "old page is not disabled");
yield restore();
}

View File

@ -531,6 +531,12 @@ let DirectoryLinksProvider = {
_updateRelatedTile: function() {
let sortedLinks = NewTabUtils.getProviderLinks(this);
if (!sortedLinks) {
// If NewTabUtils.links.resetCache() is called before getting here,
// sortedLinks may be undefined.
return;
}
// Delete the current related tile, if one exists.
let initialLength = sortedLinks.length;
this.maxNumLinks = initialLength;

View File

@ -936,7 +936,7 @@ let Links = {
// Build a list containing a copy of each provider's sortedLinks list.
let linkLists = [];
for (let links of this._providers.values()) {
if (links) {
if (links && links.sortedLinks) {
linkLists.push(links.sortedLinks.slice());
}
}