Bug 916497 - PageThumbs no longer expires thumnails being tested to fix intermittent oranges. r=adw

This commit is contained in:
Mark Hammond 2014-05-14 11:09:31 +10:00
parent 88852bec9b
commit f8bf8d156c
4 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,7 @@ function runTests() {
bgTestPageURL({ wait: 2002 }), bgTestPageURL({ wait: 2002 }),
"http://www.example.com/2", "http://www.example.com/2",
]; ];
dontExpireThumbnailURLs(urls);
urls.forEach(url => { urls.forEach(url => {
ok(!thumbnailExists(url), "Thumbnail should not exist yet: " + url); ok(!thumbnailExists(url), "Thumbnail should not exist yet: " + url);
let isTimeoutTest = url.indexOf("wait") >= 0; let isTimeoutTest = url.indexOf("wait") >= 0;

View File

@ -3,11 +3,16 @@
const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/" + const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/" +
"test/background_red_redirect.sjs"; "test/background_red_redirect.sjs";
// loading URL will redirect us to...
const FINAL_URL = "http://mochi.test:8888/browser/toolkit/components/" +
"thumbnails/test/background_red.html";
/** /**
* These tests ensure that we save and provide thumbnails for redirecting sites. * These tests ensure that we save and provide thumbnails for redirecting sites.
*/ */
function runTests() { function runTests() {
dontExpireThumbnailURLs([URL, FINAL_URL]);
// Kick off history by loading a tab first or the test fails in single mode. // Kick off history by loading a tab first or the test fails in single mode.
yield addTab(URL); yield addTab(URL);
gBrowser.removeTab(gBrowser.selectedTab); gBrowser.removeTab(gBrowser.selectedTab);

View File

@ -18,6 +18,8 @@ XPCOMUtils.defineLazyGetter(this, "Sanitizer", function () {
* be removed when the user sanitizes their history. * be removed when the user sanitizes their history.
*/ */
function runTests() { function runTests() {
dontExpireThumbnailURLs([URL, URL_COPY]);
yield clearHistory(); yield clearHistory();
yield addVisitsAndRepopulateNewTabLinks(URL, next); yield addVisitsAndRepopulateNewTabLinks(URL, next);
yield createThumbnail(); yield createThumbnail();

View File

@ -121,6 +121,9 @@ function whenLoaded(aElement, aCallback = next) {
*/ */
function captureAndCheckColor(aRed, aGreen, aBlue, aMessage) { function captureAndCheckColor(aRed, aGreen, aBlue, aMessage) {
let browser = gBrowser.selectedBrowser; let browser = gBrowser.selectedBrowser;
// We'll get oranges if the expiration filter removes the file during the
// test.
dontExpireThumbnailURLs([browser.currentURI.spec]);
// Capture the screenshot. // Capture the screenshot.
PageThumbs.captureAndStore(browser, function () { PageThumbs.captureAndStore(browser, function () {
@ -325,6 +328,9 @@ function bgCaptureIfMissing(aURL, aOptions) {
} }
function bgCaptureWithMethod(aMethodName, aURL, aOptions = {}) { function bgCaptureWithMethod(aMethodName, aURL, aOptions = {}) {
// We'll get oranges if the expiration filter removes the file during the
// test.
dontExpireThumbnailURLs([aURL]);
if (!aOptions.onDone) if (!aOptions.onDone)
aOptions.onDone = next; aOptions.onDone = next;
BackgroundPageThumbs[aMethodName](aURL, aOptions); BackgroundPageThumbs[aMethodName](aURL, aOptions);