summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/history
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/places/tests/history')
-rw-r--r--toolkit/components/places/tests/history/test_async_history_api.js10
-rw-r--r--toolkit/components/places/tests/history/test_insertMany.js21
-rw-r--r--toolkit/components/places/tests/history/test_removeByFilter.js4
-rw-r--r--toolkit/components/places/tests/history/test_removeVisitsByFilter.js2
-rw-r--r--toolkit/components/places/tests/history/test_updatePlaces_embed.js8
5 files changed, 32 insertions, 13 deletions
diff --git a/toolkit/components/places/tests/history/test_async_history_api.js b/toolkit/components/places/tests/history/test_async_history_api.js
index ce0d96b306..cc645baaec 100644
--- a/toolkit/components/places/tests/history/test_async_history_api.js
+++ b/toolkit/components/places/tests/history/test_async_history_api.js
@@ -32,7 +32,7 @@ function VisitInfo(aTransitionType, aVisitTime) {
}
function promiseUpdatePlaces(aPlaces, aOptions = {}) {
- return new Promise((resolve, reject) => {
+ return new Promise(resolve => {
asyncHistory.updatePlaces(
aPlaces,
Object.assign(
@@ -974,7 +974,7 @@ add_task(async function test_title_change_notifies() {
place.title = "title 1";
let expectedNotification = false;
let titleChangeObserver;
- let titleChangePromise = new Promise((resolve, reject) => {
+ let titleChangePromise = new Promise(resolve => {
titleChangeObserver = new TitleChangedObserver(
place.uri,
place.title,
@@ -1032,8 +1032,8 @@ add_task(async function test_visit_notifies() {
};
Assert.equal(false, await PlacesUtils.history.hasVisits(place.uri));
- function promiseVisitObserver(aPlace) {
- return new Promise((resolve, reject) => {
+ function promiseVisitObserver() {
+ return new Promise(resolve => {
let callbackCount = 0;
let finisher = function () {
if (++callbackCount == 2) {
@@ -1137,7 +1137,7 @@ add_task(async function test_omit_frecency_notifications() {
// we won't get a ranking changed notification until recalculation happens.
await PlacesUtils.history.clear();
let notified = false;
- let listener = events => {
+ let listener = () => {
notified = true;
PlacesUtils.observers.removeListener(["pages-rank-changed"], listener);
};
diff --git a/toolkit/components/places/tests/history/test_insertMany.js b/toolkit/components/places/tests/history/test_insertMany.js
index b2cf60ed91..3d0774cbf2 100644
--- a/toolkit/components/places/tests/history/test_insertMany.js
+++ b/toolkit/components/places/tests/history/test_insertMany.js
@@ -189,7 +189,7 @@ add_task(async function test_transitions() {
await PlacesUtils.history.insertMany(places);
// Check callbacks.
let count = 0;
- await PlacesUtils.history.insertMany(places, pageInfo => {
+ await PlacesUtils.history.insertMany(places, () => {
++count;
});
Assert.equal(count, Object.keys(PlacesUtils.history.TRANSITIONS).length);
@@ -246,3 +246,22 @@ add_task(async function test_guid() {
"Record C is fetchable after insertMany"
);
});
+
+add_task(async function test_withUserPass() {
+ await PlacesUtils.history.insertMany([
+ {
+ url: "http://user:pass@example.com/userpass",
+ visits: [{ date: new Date() }],
+ },
+ ]);
+
+ Assert.ok(
+ !(await PlacesUtils.history.fetch("http://user:pass@example.com/userpass")),
+ "The url with user and pass is not stored"
+ );
+
+ Assert.ok(
+ await PlacesUtils.history.fetch("http://example.com/userpass"),
+ "The url without user and pass is stored"
+ );
+});
diff --git a/toolkit/components/places/tests/history/test_removeByFilter.js b/toolkit/components/places/tests/history/test_removeByFilter.js
index fb18bf8e74..fe90977bfd 100644
--- a/toolkit/components/places/tests/history/test_removeByFilter.js
+++ b/toolkit/components/places/tests/history/test_removeByFilter.js
@@ -174,13 +174,13 @@ add_task(async function test_removeByFilter() {
for (let callbackUse of [true, false]) {
// Case A Positives
for (let bookmarkUse of [true, false]) {
- let bookmarkedUri = arr => undefined;
+ let bookmarkedUri = () => undefined;
let checkableArray = arr => arr;
let checkClosure = assertNotInDB;
if (bookmarkUse) {
bookmarkedUri = arr => arr[0];
checkableArray = arr => arr.slice(1);
- checkClosure = function (aUri) {};
+ checkClosure = function () {};
}
// Case A 1: Dates
await removeByFilterTester(
diff --git a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js
index 5681ab22bc..be01fcb901 100644
--- a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js
+++ b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js
@@ -117,7 +117,7 @@ add_task(async function test_removeVisitsByFilter() {
}
endIndex = Math.min(
endIndex,
- removedItems.findIndex((v, index) => v.uri.spec != rawURL) - 1
+ removedItems.findIndex(v => v.uri.spec != rawURL) - 1
);
}
removedItems.splice(endIndex + 1);
diff --git a/toolkit/components/places/tests/history/test_updatePlaces_embed.js b/toolkit/components/places/tests/history/test_updatePlaces_embed.js
index a2831f2f58..84efd11b2d 100644
--- a/toolkit/components/places/tests/history/test_updatePlaces_embed.js
+++ b/toolkit/components/places/tests/history/test_updatePlaces_embed.js
@@ -28,10 +28,10 @@ add_task(async function test_embed_visit() {
asyncHistory.updatePlaces(place, {
ignoreErrors: true,
ignoreResults: true,
- handleError(aResultCode, aPlace) {
+ handleError() {
errors++;
},
- handleResult(aPlace) {
+ handleResult() {
results++;
},
handleCompletion(resultCount) {
@@ -64,10 +64,10 @@ add_task(async function test_misc_visits() {
asyncHistory.updatePlaces(place, {
ignoreErrors: true,
ignoreResults: true,
- handleError(aResultCode, aPlace) {
+ handleError() {
errors++;
},
- handleResult(aPlace) {
+ handleResult() {
results++;
},
handleCompletion(resultCount) {