Backed out changeset 81156ff3f4fa (bug 1571656) for causing browser_PageActions.js and test_insertTree_fixupOrSkipInvalidEntries.js to perma fail CLOSED TREE

This commit is contained in:
Ciure Andrei 2019-08-19 13:00:44 +03:00
parent 3e56e9eb4b
commit 9a123fb597
30 changed files with 63 additions and 83 deletions

View File

@ -45,6 +45,6 @@ add_task(async function test_IE_history() {
let entry = await PlacesUtils.history.fetch(url, { includeVisits: true });
Assert.equal(entry.url, url, "Should have the correct URL");
Assert.equal(entry.title, title, "Should have the correct title");
Assert.greater(entry.visits.length, 0, "Should have some visits");
Assert.ok(entry.visits.length > 0, "Should have some visits");
}
});

View File

@ -38,7 +38,7 @@ add_task(async function() {
},
dialog => {
let savedItemId = dialog.gEditItemOverlay.itemId;
Assert.greater(savedItemId, 0, "Found the itemId");
Assert.ok(savedItemId > 0, "Found the itemId");
return PlacesTestUtils.waitForNotification(
"onItemRemoved",
id => id === savedItemId

View File

@ -145,7 +145,7 @@ add_task(async function test_query_on_toolbar() {
});
// Get first child and check it is the just inserted query.
Assert.greater(toolbarNode.childCount, 0, "Toolbar node has children");
Assert.ok(toolbarNode.childCount > 0, "Toolbar node has children");
let queryNode = toolbarNode.getChild(0);
Assert.equal(
queryNode.title,

View File

@ -132,7 +132,7 @@ add_task(async function test_separator_first() {
await promiseReady;
let children = gToolbarContent.children;
Assert.greater(children.length, 2, "Multiple elements are visible");
Assert.ok(children.length > 2, "Multiple elements are visible");
Assert.equal(
children[1]._placesNode.uri,
"http://test.places.0/",

View File

@ -80,7 +80,7 @@ async function setupBackgroundTabs(testFn) {
* background state.
*/
async function crashBackgroundTabs(tabs) {
Assert.greater(tabs.length, 0, "Need to crash at least one tab.");
Assert.ok(tabs.length > 0, "Need to crash at least one tab.");
for (let tab of tabs) {
Assert.ok(tab.linkedBrowser.isRemoteBrowser, "tab is remote");
}

View File

@ -21,7 +21,7 @@ add_task(async function test() {
);
let resultCount = UrlbarTestUtils.getResultCount(window);
Assert.greater(resultCount, 0, "At least one result");
Assert.ok(resultCount > 0, "At least one result");
for (let i = 0; i < resultCount; i++) {
EventUtils.synthesizeKey("KEY_ArrowDown");

View File

@ -62,11 +62,7 @@ add_task(async function test() {
var viewBookmark = content.document.querySelector("a#viewBookmark");
viewBookmark.click();
Assert.greater(
viewBookmark.href.length,
0,
"viewBookmark button has href"
);
Assert.ok(viewBookmark.href.length > 0, "viewBookmark button has href");
var viewer = content.wrappedJSObject.PDFViewerApplication;
await viewer.close();

View File

@ -310,11 +310,7 @@ add_task(async function simple() {
// unregister
PageActions._actionsByID.delete(action.id);
let index = PageActions._nonBuiltInActions.findIndex(a => a.id == action.id);
Assert.greaterEqual(
index,
0,
"Action should be in _nonBuiltInActions to begin with"
);
Assert.ok(index >= 0, "Action should be in _nonBuiltInActions to begin with");
PageActions._nonBuiltInActions.splice(index, 1);
// register again

View File

@ -575,7 +575,7 @@ add_task(async function test_dont_decrement_chances_on_same_day() {
let initChances = UnsubmittedCrashHandler.prefs.getIntPref(
"chancesUntilSuppress"
);
Assert.greater(initChances, 1, "We should start with at least 1 chance.");
Assert.ok(initChances > 1, "We should start with at least 1 chance.");
await createPendingCrashReports(1);
let notification = await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
@ -625,7 +625,7 @@ add_task(async function test_decrement_chances_on_other_day() {
let initChances = UnsubmittedCrashHandler.prefs.getIntPref(
"chancesUntilSuppress"
);
Assert.greater(initChances, 1, "We should start with at least 1 chance.");
Assert.ok(initChances > 1, "We should start with at least 1 chance.");
await createPendingCrashReports(1);
let notification = await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();

View File

@ -148,14 +148,14 @@ add_task(async function test() {
let results = await ChromeUtils.requestPerformanceMetrics();
exploreResults(results);
Assert.greater(workerDuration, 0, "Worker duration should be positive");
Assert.greater(workerTotal, 0, "Worker count should be positive");
Assert.greater(duration, 0, "Duration should be positive");
Assert.greater(total, 0, "Should get a positive count");
Assert.ok(workerDuration > 0, "Worker duration should be positive");
Assert.ok(workerTotal > 0, "Worker count should be positive");
Assert.ok(duration > 0, "Duration should be positive");
Assert.ok(total > 0, "Should get a positive count");
Assert.ok(parentProcessEvent, "parent process sent back some events");
Assert.ok(isTopLevel, "example.com as a top level window");
Assert.ok(aboutMemoryFound, "about:memory");
Assert.greater(heapUsage, 0, "got some memory value reported");
Assert.ok(heapUsage > 0, "got some memory value reported");
Assert.ok(sharedWorker, "We got some info from a shared worker");
let numCounters = counterIds.length;
Assert.ok(
@ -185,8 +185,8 @@ add_task(async function test() {
workerTotal > previousWorkerTotal,
"Worker count should be positive"
);
Assert.greater(duration, previousDuration, "Duration should be positive");
Assert.greater(total, previousTotal, "Should get a positive count");
Assert.ok(duration > previousDuration, "Duration should be positive");
Assert.ok(total > previousTotal, "Should get a positive count");
// load a tab with a setInterval, we should get counters on TaskCategory::Timer
await BrowserTestUtils.withNewTab(
@ -196,7 +196,7 @@ add_task(async function test() {
let previousTimerCalls = timerCalls;
results = await ChromeUtils.requestPerformanceMetrics();
exploreResults(results, tabId);
Assert.greater(timerCalls, previousTimerCalls, "Got timer calls");
Assert.ok(timerCalls > previousTimerCalls, "Got timer calls");
}
);
@ -208,7 +208,7 @@ add_task(async function test() {
let previousTimerCalls = timerCalls;
results = await ChromeUtils.requestPerformanceMetrics();
exploreResults(results, tabId);
Assert.greater(timerCalls, previousTimerCalls, "Got timer calls");
Assert.ok(timerCalls > previousTimerCalls, "Got timer calls");
}
);
@ -219,7 +219,7 @@ add_task(async function test() {
let tabId = gBrowser.selectedBrowser.outerWindowID;
results = await ChromeUtils.requestPerformanceMetrics();
exploreResults(results, tabId);
Assert.greater(mediaMemory, 0, "Got some memory used for media");
Assert.ok(mediaMemory > 0, "Got some memory used for media");
}
);
}

View File

@ -244,11 +244,7 @@ function run_test() {
numMigrated += 1;
}
// check we found at least 1 record that was migrated.
Assert.greater(
numMigrated,
0,
"we found at least 1 record that was migrated"
);
Assert.ok(numMigrated > 0, "we found at least 1 record that was migrated");
// This permission should always be there.
let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(

View File

@ -33,7 +33,7 @@ function run_test()
const pattern = osprefs.getDateTimePattern(...test);
if (test[0] !== osprefs.dateTimeFormatStyleNone &&
test[1] !== osprefs.dateTImeFormatStyleNone) {
Assert.greater(pattern.length, 0, "pattern is not empty.");
Assert.ok(pattern.length > 0, "pattern is not empty.");
}
}

View File

@ -15,8 +15,8 @@ async function testBody() {
do_log_info("now: " + now / 1000000);
do_log_info("startHibernation: " + startHibernation / 1000000);
do_log_info("stopHibernation: " + stopHibernation / 1000000);
Assert.less(startHibernation, now, "startHibernation ok");
Assert.less(stopHibernation, now, "stopHibernation ok");
Assert.ok(startHibernation < now, "startHibernation ok");
Assert.ok(stopHibernation < now, "stopHibernation ok");
// When the watchdog runs, it hibernates if there's been no activity for the
// last 2 seconds, otherwise it sleeps for 1 second. As such, given perfect
@ -42,8 +42,8 @@ async function testBody() {
// making sure this behavior is roughly as expected on the macro scale,
// so we add a 1 second fuzz factor here.
const FUZZ_FACTOR = 1 * 1000 * 1000;
Assert.greater(stateChange, now + 10*1000*1000 - FUZZ_FACTOR, "stateChange ok");
Assert.greater(startHibernation, now + 2*1000*1000 - FUZZ_FACTOR, "startHibernation ok");
Assert.less(startHibernation, now + 5*1000*1000 + FUZZ_FACTOR, "startHibernation ok");
Assert.greater(stopHibernation, now + 10*1000*1000 - FUZZ_FACTOR, "stopHibernation ok");
Assert.ok(stateChange > now + 10*1000*1000 - FUZZ_FACTOR, "stateChange ok");
Assert.ok(startHibernation > now + 2*1000*1000 - FUZZ_FACTOR, "startHibernation ok");
Assert.ok(startHibernation < now + 5*1000*1000 + FUZZ_FACTOR, "startHibernation ok");
Assert.ok(stopHibernation > now + 10*1000*1000 - FUZZ_FACTOR, "stopHibernation ok");
}

View File

@ -1001,7 +1001,7 @@ function CustomPipe(name) {
"])"
);
Assert.greater(increments.length, 0, "bad increments");
Assert.ok(increments.length > 0, "bad increments");
Assert.ok(
increments.every(function(v) {
return v > 0;

View File

@ -611,7 +611,7 @@ add_task(async function test_ignore_system() {
let addon = reconciler.getAddonStateFromSyncGUID(guid);
Assert.notEqual(addon.id, SYSTEM_ADDON_ID);
}
Assert.greater(num, 1, "should have seen at least one.");
Assert.ok(num > 1, "should have seen at least one.");
});
add_task(async function test_incoming_system() {

View File

@ -114,7 +114,7 @@ async function test_addCrashBase(crashId, allThreads) {
}
let frames = stackTraces.threads[0].frames;
Assert.greater(frames && frames.length, 0, "The stack trace is present.\n");
Assert.ok(frames && frames.length > 0, "The stack trace is present.\n");
} catch (e) {
Assert.ok(false, "StackTraces does not contain valid JSON.");
}

View File

@ -382,7 +382,7 @@ add_task(async function create_bookmark_frecency() {
checkBookmarkObject(bm);
await PlacesTestUtils.promiseAsyncUpdates();
Assert.greater(frecencyForUrl(bm.url), 0, "Check frecency has been updated");
Assert.ok(frecencyForUrl(bm.url) > 0, "Check frecency has been updated");
});
add_task(async function create_bookmark_without_type() {

View File

@ -308,7 +308,7 @@ add_task(async function update_url() {
checkBookmarkObject(bm);
let lastModified = bm.lastModified;
let frecency = frecencyForUrl(bm.url);
Assert.greater(frecency, 0, "Check frecency has been updated");
Assert.ok(frecency > 0, "Check frecency has been updated");
bm = await PlacesUtils.bookmarks.update({
guid: bm.guid,

View File

@ -32,7 +32,7 @@ add_task(async function() {
event.index == 0 || event.index == lastIndex + 1,
"Consecutive indices"
);
Assert.greaterEqual(event.dateAdded, now, "Found a valid dateAdded");
Assert.ok(event.dateAdded >= now, "Found a valid dateAdded");
Assert.ok(PlacesUtils.isValidGuid(event.guid), "guid is valid");
}
},

View File

@ -906,9 +906,9 @@ async function compareFavicons(icon1, icon2, msg) {
}
let data1 = await getIconData(icon1);
Assert.greater(data1.length, 0, "Should fetch icon data");
Assert.ok(data1.length > 0, "Should fetch icon data");
let data2 = await getIconData(icon2);
Assert.greater(data2.length, 0, "Should fetch icon data");
Assert.ok(data2.length > 0, "Should fetch icon data");
Assert.deepEqual(data1, data2, msg);
}

View File

@ -13,7 +13,7 @@ add_task(async function setup() {
}
version--;
}
Assert.greater(version, 0, "Found a valid database version");
Assert.ok(version > 0, "Found a valid database version");
await setupPlacesDatabase(`places_v${version}.sqlite`);
// Downgrade the schema version to the first supported one.
let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);

View File

@ -33,7 +33,7 @@ add_task(async function test_eraseEverything() {
Assert.equal(root.childCount, 4, "The folder should have 4 children");
for (let i = 0; i < root.childCount; ++i) {
let node = root.getChild(i);
Assert.greater(node.itemId, 0, "The node should have an itemId");
Assert.ok(node.itemId > 0, "The node should have an itemId");
}
Assert.equal(root.getChild(0).title, "title 1");
Assert.equal(root.getChild(1).title, "title 2");

View File

@ -259,15 +259,15 @@ add_task(async function groupByHost() {
let httpFrec = frecencyForUrl("http://example.com/");
let httpsFrec = frecencyForUrl("https://example.com/");
let otherFrec = frecencyForUrl("https://mozilla.org/");
Assert.less(httpFrec, httpsFrec, "Sanity check");
Assert.less(httpsFrec, otherFrec, "Sanity check");
Assert.ok(httpFrec < httpsFrec, "Sanity check");
Assert.ok(httpsFrec < otherFrec, "Sanity check");
// Make sure the frecencies of the three origins are as expected in relation
// to the threshold.
let threshold = await getOriginAutofillThreshold();
Assert.less(httpFrec, threshold, "http origin should be < threshold");
Assert.less(httpsFrec, threshold, "https origin should be < threshold");
Assert.lessEqual(threshold, otherFrec, "Other origin should cross threshold");
Assert.ok(httpFrec < threshold, "http origin should be < threshold");
Assert.ok(httpsFrec < threshold, "https origin should be < threshold");
Assert.ok(threshold <= otherFrec, "Other origin should cross threshold");
Assert.ok(
threshold <= httpFrec + httpsFrec,
@ -328,15 +328,15 @@ add_task(async function groupByHostNonDefaultStddevMultiplier() {
let httpFrec = frecencyForUrl("http://example.com/");
let httpsFrec = frecencyForUrl("https://example.com/");
let otherFrec = frecencyForUrl("https://mozilla.org/");
Assert.less(httpFrec, httpsFrec, "Sanity check");
Assert.less(httpsFrec, otherFrec, "Sanity check");
Assert.ok(httpFrec < httpsFrec, "Sanity check");
Assert.ok(httpsFrec < otherFrec, "Sanity check");
// Make sure the frecencies of the three origins are as expected in relation
// to the threshold.
let threshold = await getOriginAutofillThreshold();
Assert.less(httpFrec, threshold, "http origin should be < threshold");
Assert.less(httpsFrec, threshold, "https origin should be < threshold");
Assert.lessEqual(threshold, otherFrec, "Other origin should cross threshold");
Assert.ok(httpFrec < threshold, "http origin should be < threshold");
Assert.ok(httpsFrec < threshold, "https origin should be < threshold");
Assert.ok(threshold <= otherFrec, "Other origin should cross threshold");
Assert.ok(
threshold <= httpFrec + httpsFrec,

View File

@ -756,11 +756,7 @@ function checkSystemSection(data) {
Assert.ok(Array.isArray(gfxData.monitors));
if (gIsWindows || gIsMac || gIsLinux) {
Assert.greaterEqual(
gfxData.monitors.length,
1,
"There is at least one monitor."
);
Assert.ok(gfxData.monitors.length >= 1, "There is at least one monitor.");
Assert.equal(typeof gfxData.monitors[0].screenWidth, "number");
Assert.equal(typeof gfxData.monitors[0].screenHeight, "number");
if (gIsWindows) {

View File

@ -69,7 +69,7 @@ add_task(async function test_record() {
Assert.ok(PHASE0 in data, "The file contains the expected key");
let duration = data[PHASE0];
Assert.equal(typeof duration, "number");
Assert.greaterEqual(duration, 0, "Duration is a non-negative number");
Assert.ok(duration >= 0, "Duration is a non-negative number");
Assert.ok(
duration <= Math.ceil((t1 - t0) / 1000) + 1,
"Duration is reasonable"

View File

@ -1053,7 +1053,7 @@ add_task(async function getTopFrencentSites_maxLimit() {
links.length < MANY_LINKS,
"query default limited to less than many"
);
Assert.greater(links.length, 6, "query default to more than visible count");
Assert.ok(links.length > 6, "query default to more than visible count");
});
add_task(async function getTopFrencentSites_allowedProtocols() {

View File

@ -14,7 +14,7 @@ add_task(async function test_setTimeout() {
100
);
Assert.equal(typeof timeout1, "number", "setTimeout returns a number");
Assert.greater(timeout1, 0, "setTimeout returns a positive number");
Assert.ok(timeout1 > 0, "setTimeout returns a positive number");
imported.clearTimeout(timeout1);
@ -32,7 +32,7 @@ add_task(async function test_setTimeout() {
);
Assert.equal(typeof timeout2, "number", "setTimeout returns a number");
Assert.greater(timeout2, 0, "setTimeout returns a positive number");
Assert.ok(timeout2 > 0, "setTimeout returns a positive number");
Assert.notEqual(
timeout1,
timeout2,
@ -49,7 +49,7 @@ add_task(async function test_setTimeoutWithTarget() {
target
);
Assert.equal(typeof timeout1, "number", "setTimeout returns a number");
Assert.greater(timeout1, 0, "setTimeout returns a positive number");
Assert.ok(timeout1 > 0, "setTimeout returns a positive number");
imported.clearTimeout(timeout1);
@ -68,7 +68,7 @@ add_task(async function test_setTimeoutWithTarget() {
);
Assert.equal(typeof timeout2, "number", "setTimeout returns a number");
Assert.greater(timeout2, 0, "setTimeout returns a positive number");
Assert.ok(timeout2 > 0, "setTimeout returns a positive number");
Assert.notEqual(
timeout1,
timeout2,
@ -83,7 +83,7 @@ add_task(async function test_setInterval() {
100
);
Assert.equal(typeof interval1, "number", "setInterval returns a number");
Assert.greater(interval1, 0, "setTimeout returns a positive number");
Assert.ok(interval1 > 0, "setTimeout returns a positive number");
imported.clearInterval(interval1);
@ -117,7 +117,7 @@ add_task(async function test_setIntervalWithTarget() {
target
);
Assert.equal(typeof interval1, "number", "setInterval returns a number");
Assert.greater(interval1, 0, "setTimeout returns a positive number");
Assert.ok(interval1 > 0, "setTimeout returns a positive number");
imported.clearInterval(interval1);
@ -177,7 +177,7 @@ add_task(async function test_requestIdleCallback() {
"number",
"requestIdleCallback returns a number"
);
Assert.greater(request1, 0, "setTimeout returns a positive number");
Assert.ok(request1 > 0, "setTimeout returns a positive number");
imported.cancelIdleCallback(request1);
@ -205,11 +205,7 @@ add_task(async function test_requestIdleCallback() {
"number",
"requestIdleCallback returns a number"
);
Assert.greater(
request2,
0,
"requestIdleCallback returns a positive number"
);
Assert.ok(request2 > 0, "requestIdleCallback returns a positive number");
Assert.notEqual(
request1,
request2,

View File

@ -8,7 +8,7 @@ add_task(async function test_long_id() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
await promiseStartupManager();
Assert.greater(ID.length, 64, "ID is > 64 characters");
Assert.ok(ID.length > 64, "ID is > 64 characters");
await promiseInstallFile(do_get_file("data/signing_checks/long.xpi"));
let addon = await promiseAddonByID(ID);

View File

@ -34,9 +34,9 @@ add_task(async function test_proc_info() {
}
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1529023
if (!MAC) {
Assert.greater(cpuThreads, 0, "Got some cpu time in the threads");
Assert.ok(cpuThreads > 0, "Got some cpu time in the threads");
}
Assert.greater(cpuUser, 0, "Got some cpu time");
Assert.ok(cpuUser > 0, "Got some cpu time");
}
);
});

View File

@ -10,7 +10,7 @@ function test_getSharingProviders() {
Ci.nsIMacSharingService
);
let providers = sharingService.getSharingProviders("http://example.org");
Assert.greater(providers.length, 1, "There are providers returned");
Assert.ok(providers.length > 1, "There are providers returned");
providers.forEach(provider => {
Assert.ok("name" in provider, "Provider has name");
Assert.ok("menuItemTitle" in provider, "Provider has menuItemTitle");