chore(lint): Enable and autofix comma-dangle never.
This commit is contained in:
Родитель
95e6dae527
Коммит
7410e4b21a
|
@ -63,7 +63,7 @@
|
|||
"block-spacing": [2, "never"],
|
||||
"brace-style": 0,
|
||||
"camelcase": 0,
|
||||
"comma-dangle": 0,
|
||||
"comma-dangle": [2, "never"],
|
||||
"comma-spacing": 2,
|
||||
"comma-style": 2,
|
||||
"computed-property-spacing": [2, "never"],
|
||||
|
|
|
@ -53,7 +53,7 @@ am.ACTIONS_WITH_SITES = new Set([
|
|||
"TOP_FRECENT_SITES_RESPONSE",
|
||||
"RECENT_BOOKMARKS_RESPONSE",
|
||||
"RECENT_LINKS_RESPONSE",
|
||||
"HIGHLIGHTS_LINKS_RESPONSE",
|
||||
"HIGHLIGHTS_LINKS_RESPONSE"
|
||||
].map(type => am.type(type)));
|
||||
|
||||
function Notify(type, data) {
|
||||
|
|
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
// Thresholds for highlights query
|
||||
HIGHLIGHTS_THRESHOLDS: {
|
||||
created: "-3 day",
|
||||
visited: "-30 minutes",
|
||||
visited: "-30 minutes"
|
||||
},
|
||||
|
||||
// This is how many pixels before the bottom that
|
||||
|
|
|
@ -20,7 +20,7 @@ const LinkMenu = React.createClass({
|
|||
event,
|
||||
page,
|
||||
source,
|
||||
action_position: index,
|
||||
action_position: index
|
||||
};
|
||||
if (site.recommended) {
|
||||
payload.url = site.url;
|
||||
|
|
|
@ -10,7 +10,7 @@ const MediaPreview = React.createClass({
|
|||
|
||||
getDefaultProps() {
|
||||
return {
|
||||
previewInfo: {},
|
||||
previewInfo: {}
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -46,7 +46,7 @@ MediaPreview.propTypes = {
|
|||
previewInfo: React.PropTypes.shape({
|
||||
previewURL: React.PropTypes.string,
|
||||
thumbnail: React.PropTypes.object,
|
||||
type: React.PropTypes.string,
|
||||
type: React.PropTypes.string
|
||||
})
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ const NewTabPage = React.createClass({
|
|||
return {
|
||||
showSettingsMenu: false,
|
||||
renderedOnce: false,
|
||||
showRecommendations: true,
|
||||
showRecommendations: true
|
||||
};
|
||||
},
|
||||
toggleRecommendation() {
|
||||
|
|
|
@ -244,7 +244,7 @@ const Search = React.createClass({
|
|||
onMouseMove(newIndex) {
|
||||
this.setState({
|
||||
activeIndex: newIndex,
|
||||
activeSuggestionIndex: newIndex,
|
||||
activeSuggestionIndex: newIndex
|
||||
});
|
||||
},
|
||||
render() {
|
||||
|
|
|
@ -103,7 +103,7 @@ const Spotlight = React.createClass({
|
|||
page: this.props.page,
|
||||
source: "FEATURED",
|
||||
action_position: index,
|
||||
highlight_type: site.type,
|
||||
highlight_type: site.type
|
||||
};
|
||||
if (site.recommended) {
|
||||
payload.url = site.url;
|
||||
|
|
|
@ -12,7 +12,7 @@ const channel = new Channel({
|
|||
const middleware = [
|
||||
thunk,
|
||||
channel.middleware,
|
||||
require("lib/parse-url-middleware"),
|
||||
require("lib/parse-url-middleware")
|
||||
];
|
||||
|
||||
// Logging for debugging redux actions
|
||||
|
|
|
@ -102,7 +102,7 @@ describe("GroupedActivityFeed", function() {
|
|||
sites = [
|
||||
faker.createSite({moment: faker.moment()}),
|
||||
faker.createSite({moment: faker.moment().subtract(2, "days")}),
|
||||
faker.createSite({moment: faker.moment().subtract(4, "days")}),
|
||||
faker.createSite({moment: faker.moment().subtract(4, "days")})
|
||||
];
|
||||
instance = renderWithProvider(<GroupedActivityFeed sites={sites} />);
|
||||
el = ReactDOM.findDOMNode(instance);
|
||||
|
@ -207,7 +207,7 @@ describe("groupSitesBySession", () => {
|
|||
{url: "foo1.com", dateDisplay: testDate},
|
||||
{url: "foo2.com", dateDisplay: testDate - 3 * minute},
|
||||
{url: "foo3.com", dateDisplay: testDate - 14 * minute},
|
||||
{url: "foo4.com", dateDisplay: testDate - 15 * minute},
|
||||
{url: "foo4.com", dateDisplay: testDate - 15 * minute}
|
||||
];
|
||||
const result = groupSitesBySession(testSites);
|
||||
it("should create an array of arrays", () => {
|
||||
|
|
|
@ -10,9 +10,9 @@ const fakeProps = {
|
|||
thumbnail: {
|
||||
"url": "https://i.ytimg.com/vi/lDv68xYHFXM/hqdefault.jpg",
|
||||
"height": 360,
|
||||
"width": 480,
|
||||
"width": 480
|
||||
},
|
||||
type: "video",
|
||||
type: "video"
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ describe("Timeline", () => {
|
|||
init: true,
|
||||
isLoading: false,
|
||||
canLoadMore: true,
|
||||
rows: mockData.History.rows,
|
||||
rows: mockData.History.rows
|
||||
},
|
||||
dateKey: "lastVisitDate",
|
||||
pageName: "TIMELINE_ALL",
|
||||
|
@ -100,7 +100,7 @@ describe("Timeline", () => {
|
|||
});
|
||||
it("should show Loader if History.isLoading is true", () => {
|
||||
setup({
|
||||
Feed: Object.assign({}, fakeProps.Feed, {isLoading: true}),
|
||||
Feed: Object.assign({}, fakeProps.Feed, {isLoading: true})
|
||||
});
|
||||
assert.equal(loaderEl.hidden, false);
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ const fakeProps = {
|
|||
favicon_url: "http://foo.com/favicon.ico"
|
||||
},
|
||||
{
|
||||
url: "http://bar.com",
|
||||
url: "http://bar.com"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ describe("randomWeighter", () => {
|
|||
it("should build the correct array of items based on weight", () => {
|
||||
const result = createWeightedArray([
|
||||
{weight: 1, value: "yes"},
|
||||
{weight: 3, value: "no"},
|
||||
{weight: 3, value: "no"}
|
||||
]);
|
||||
assert.deepEqual(result, [
|
||||
{weight: 1, value: "yes"},
|
||||
|
|
|
@ -278,7 +278,7 @@ describe("selectors", () => {
|
|||
images: [{url: "foo.jpg", height: IMG_HEIGHT, width: IMG_WIDTH}],
|
||||
media: {
|
||||
type: "video"
|
||||
},
|
||||
}
|
||||
};
|
||||
const embedPreviewURL = "https://www.youtube.com/embed/lDv68xYHFXM?autoplay=1";
|
||||
let state;
|
||||
|
|
|
@ -47,7 +47,7 @@ const DEFAULT_OPTIONS = {
|
|||
onAddWorker: null,
|
||||
onRemoveWorker: null,
|
||||
placesCacheTimeout: 1800000, // every 30 minutes, rebuild/repopulate the cache
|
||||
recommendationTTL: 3600000, // every hour, get a new recommendation
|
||||
recommendationTTL: 3600000 // every hour, get a new recommendation
|
||||
};
|
||||
|
||||
const PLACES_CHANGES_EVENTS = [
|
||||
|
@ -101,7 +101,7 @@ function ActivityStreams(metadataStore, options = {}) {
|
|||
this._previewProvider = new PreviewProvider(this._tabTracker, metadataStore);
|
||||
|
||||
this._populatingCache = {
|
||||
places: false,
|
||||
places: false
|
||||
};
|
||||
|
||||
this._asyncBuildPlacesCache();
|
||||
|
@ -391,7 +391,7 @@ ActivityStreams.prototype = {
|
|||
getRecentLinks: cache.memoize("getRecentLinks", PlacesProvider.links.getRecentLinks.bind(linksObj)),
|
||||
getHighlightsLinks: cache.memoize("getHighlightsLinks", PlacesProvider.links.getHighlightsLinks.bind(linksObj)),
|
||||
getHistorySize: cache.memoize("getHistorySize", PlacesProvider.links.getHistorySize.bind(linksObj)),
|
||||
getBookmarksSize: cache.memoize("getBookmarksSize", PlacesProvider.links.getBookmarksSize.bind(linksObj)),
|
||||
getBookmarksSize: cache.memoize("getBookmarksSize", PlacesProvider.links.getBookmarksSize.bind(linksObj))
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -411,7 +411,7 @@ ActivityStreams.prototype = {
|
|||
this._memoized.getRecentLinks(opt),
|
||||
this._memoized.getHighlightsLinks(opt),
|
||||
this._memoized.getHistorySize(opt),
|
||||
this._memoized.getBookmarksSize(opt),
|
||||
this._memoized.getBookmarksSize(opt)
|
||||
]);
|
||||
this._populatingCache.places = false;
|
||||
Services.obs.notifyObservers(null, "activity-streams-places-cache-complete", null);
|
||||
|
@ -593,7 +593,7 @@ ActivityStreams.prototype = {
|
|||
this._perfMeter.uninit();
|
||||
this._memoizer.uninit();
|
||||
this._populatingCache = {
|
||||
places: false,
|
||||
places: false
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ AppURLHider.prototype = {
|
|||
}
|
||||
|
||||
Services.ww.registerNotification(this._windowObserver);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
exports.AppURLHider = AppURLHider;
|
||||
|
|
|
@ -18,7 +18,7 @@ const VALID_TELEMETRY_TAGS = new Set([
|
|||
"HIGHLIGHTS_LINKS_RESPONSE",
|
||||
"SEARCH_STATE_REQUEST",
|
||||
"SEARCH_STATE_RESPONSE",
|
||||
"NOTIFY_PERFORMANCE",
|
||||
"NOTIFY_PERFORMANCE"
|
||||
]);
|
||||
|
||||
function PerfMeter(trackableURLs) {
|
||||
|
@ -128,7 +128,7 @@ PerfMeter.prototype = {
|
|||
openAt: Date.now(),
|
||||
events: [item],
|
||||
requests: new Map(),
|
||||
workerWasAttached: false,
|
||||
workerWasAttached: false
|
||||
};
|
||||
tab.on("ready", this.onReady);
|
||||
tab.on("close", this.onClose);
|
||||
|
@ -153,7 +153,7 @@ PerfMeter.prototype = {
|
|||
// and TAB_READY events, we introduce articficial ones starting at 0
|
||||
tabData.events = [
|
||||
{tag: "TAB_RELOAD", start: 0},
|
||||
{tag: "TAB_READY", start: 0},
|
||||
{tag: "TAB_READY", start: 0}
|
||||
];
|
||||
tabData.requests = new Map();
|
||||
tabData.openAt = Date.now();
|
||||
|
@ -164,7 +164,7 @@ PerfMeter.prototype = {
|
|||
let item = {
|
||||
tag,
|
||||
start: Date.now() - tabData.openAt,
|
||||
data,
|
||||
data
|
||||
};
|
||||
|
||||
// handle requests/response pairs
|
||||
|
@ -196,7 +196,7 @@ PerfMeter.prototype = {
|
|||
console.info(`SIZE=${total} MEAN=${mean} STD=${std} MEDIAN=${median}`); // eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
exports.PerfMeter = PerfMeter;
|
||||
|
|
|
@ -43,7 +43,7 @@ const REV_HOST_BLACKLIST = [
|
|||
"moc.oohay.hcraes.",
|
||||
"tsohlacol.",
|
||||
"oc.t.",
|
||||
".",
|
||||
"."
|
||||
].map(item => `'${item}'`);
|
||||
|
||||
const PREF_BLOCKED_URLS = "query.blockedURLs";
|
||||
|
@ -179,7 +179,7 @@ Links.prototype = {
|
|||
onDeleteURI: function historyObserver_onDeleteURI(aURI) {
|
||||
// let observers remove sensitive data associated with deleted visit
|
||||
gLinks.emit("deleteURI", {
|
||||
url: aURI.spec,
|
||||
url: aURI.spec
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -196,7 +196,7 @@ Links.prototype = {
|
|||
url: aURI.spec,
|
||||
frecency: aNewFrecency,
|
||||
lastVisitDate: aLastVisitDate,
|
||||
type: "history",
|
||||
type: "history"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -529,7 +529,7 @@ Links.prototype = {
|
|||
let links = yield this.executePlacesQuery(sqlQuery, {
|
||||
columns: ["bookmarkId", "bookmarkTitle", "bookmarkGuid", "bookmarkDateCreated", "url", "guid",
|
||||
"title", "lastVisitDate", "frecency", "type", "lastModified", "favicon", "mimeType"],
|
||||
params,
|
||||
params
|
||||
});
|
||||
|
||||
links = this._faviconBytesToDataURI(links);
|
||||
|
@ -656,7 +656,7 @@ Links.prototype = {
|
|||
let links = yield this.executePlacesQuery(sqlQuery, {
|
||||
columns: ["bookmarkId", "bookmarkTitle", "bookmarkGuid", "bookmarkDateCreated", "url", "guid",
|
||||
"title", "lastVisitDate", "frecency", "type", "lastModified", "favicon", "mimeType"],
|
||||
params,
|
||||
params
|
||||
});
|
||||
|
||||
links = this._faviconBytesToDataURI(links);
|
||||
|
@ -784,5 +784,5 @@ const gLinks = new Links();
|
|||
exports.PlacesProvider = {
|
||||
LinkChecker,
|
||||
links: gLinks,
|
||||
BlockedURLs,
|
||||
BlockedURLs
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@ Cu.import("resource://gre/modules/Task.jsm");
|
|||
const DEFAULT_OPTIONS = {
|
||||
metadataTTL: 3 * 24 * 60 * 60 * 1000, // 3 days for the metadata to live
|
||||
proxyMaxLinks: 25, // number of links embedly proxy accepts per request
|
||||
initFresh: false,
|
||||
initFresh: false
|
||||
};
|
||||
|
||||
function PreviewProvider(tabTracker, metadataStore, options = {}) {
|
||||
|
@ -319,7 +319,7 @@ PreviewProvider.prototype = {
|
|||
uninit() {
|
||||
simplePrefs.off("", this._onPrefChange);
|
||||
this._alreadyRequested = new Set();
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
exports.PreviewProvider = PreviewProvider;
|
||||
|
|
|
@ -7,7 +7,7 @@ const simplePrefs = require("sdk/simple-prefs");
|
|||
const POCKET_API_URL = "pocket.endpoint";
|
||||
|
||||
const DEFAULT_TIMEOUTS = {
|
||||
pocketTimeout: 60 * 60 * 1000, // every 1 hour, refresh the Pocket recommendations
|
||||
pocketTimeout: 60 * 60 * 1000 // every 1 hour, refresh the Pocket recommendations
|
||||
};
|
||||
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
|
|
@ -90,7 +90,7 @@ NewTabSearchProvider.prototype = {
|
|||
const favicon = engine.getIconURLBySize(ENGINE_ICON_SIZE, ENGINE_ICON_SIZE);
|
||||
let obj = {
|
||||
name: engine.name,
|
||||
iconBuffer: favicon,
|
||||
iconBuffer: favicon
|
||||
};
|
||||
return obj;
|
||||
},
|
||||
|
@ -135,7 +135,7 @@ NewTabSearchProvider.prototype = {
|
|||
asyncGetCurrentState: Task.async(function() {
|
||||
let state = {
|
||||
engines: [],
|
||||
currentEngine: this.currentEngine,
|
||||
currentEngine: this.currentEngine
|
||||
};
|
||||
const pref = Services.prefs.getCharPref(HIDDEN_ENGINES);
|
||||
const hiddenEngines = pref ? pref.split(",") : [];
|
||||
|
@ -144,7 +144,7 @@ NewTabSearchProvider.prototype = {
|
|||
let favicon = engine.getIconURLBySize(ENGINE_ICON_SIZE, ENGINE_ICON_SIZE);
|
||||
state.engines.push({
|
||||
name: engine.name,
|
||||
iconBuffer: favicon,
|
||||
iconBuffer: favicon
|
||||
});
|
||||
}
|
||||
return state;
|
||||
|
@ -181,7 +181,7 @@ NewTabSearchProvider.prototype = {
|
|||
engineName: data.engineName,
|
||||
searchString: suggestions.term,
|
||||
formHistory: suggestions.local,
|
||||
suggestions: suggestions.remote,
|
||||
suggestions: suggestions.remote
|
||||
};
|
||||
}
|
||||
return result;
|
||||
|
@ -210,7 +210,7 @@ NewTabSearchProvider.prototype = {
|
|||
} else {
|
||||
let params = {
|
||||
postData: submission.postData,
|
||||
inBackground: Services.prefs.getBoolPref("browser.tabs.loadInBackground"),
|
||||
inBackground: Services.prefs.getBoolPref("browser.tabs.loadInBackground")
|
||||
};
|
||||
browserWindow.openUILinkIn(submission.uri.spec, whereToOpen, params);
|
||||
}
|
||||
|
@ -237,11 +237,11 @@ NewTabSearchProvider.prototype = {
|
|||
const ops = {
|
||||
op: "bump",
|
||||
fieldname: controller.formHistoryParam,
|
||||
value: entry,
|
||||
value: entry
|
||||
};
|
||||
const callbacks = {
|
||||
handleCompletion: () => resolve(true),
|
||||
handleError: () => reject(),
|
||||
handleError: () => reject()
|
||||
};
|
||||
FormHistory.update(ops, callbacks);
|
||||
});
|
||||
|
@ -259,12 +259,12 @@ NewTabSearchProvider.prototype = {
|
|||
// most one such widget.
|
||||
data = {
|
||||
controller: new SearchSuggestionController(),
|
||||
previousFormHistoryResult: undefined,
|
||||
previousFormHistoryResult: undefined
|
||||
};
|
||||
this._suggestionMap.set(browser, data);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
exports.SearchProvider = {
|
||||
|
|
|
@ -304,7 +304,7 @@ TabTracker.prototype = {
|
|||
QueryInterface: XPCOMUtils.generateQI([
|
||||
Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference
|
||||
]),
|
||||
])
|
||||
};
|
||||
|
||||
exports.TabTracker = TabTracker;
|
||||
|
|
|
@ -61,7 +61,7 @@ TippyTopProvider.prototype = {
|
|||
domain = domain.slice(4);
|
||||
}
|
||||
return domain;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
exports.TippyTopProvider = TippyTopProvider;
|
||||
|
|
|
@ -180,7 +180,7 @@ const PlacesTestUtils = Object.freeze({
|
|||
insertAndBookmarkVisit: Task.async(function*(url) {
|
||||
yield this.addVisits({uri: NetUtil.newURI(url), visitDate: Date.now(), transition: PlacesUtils.history.TRANSITION_LINK});
|
||||
yield Bookmarks.insert({url, parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK});
|
||||
}),
|
||||
})
|
||||
});
|
||||
|
||||
exports.PlacesTestUtils = PlacesTestUtils;
|
||||
|
|
|
@ -59,7 +59,7 @@ function getTestActivityStream(options = {}) {
|
|||
asyncReset() {return Promise.resolve();},
|
||||
asyncClose() {return Promise.resolve();},
|
||||
asyncInsert() {return Promise.resolve();},
|
||||
asyncGetMetadataByCacheKey() {return Promise.resolve([]);},
|
||||
asyncGetMetadataByCacheKey() {return Promise.resolve([]);}
|
||||
};
|
||||
let mockApp = new ActivityStreams(mockMetadataStore, options);
|
||||
return mockApp;
|
||||
|
|
|
@ -35,7 +35,7 @@ let makeNotifsPromise = cacheStatus => {
|
|||
"getTopFrecentSites-cache",
|
||||
"getRecentBookmarks-cache",
|
||||
"getRecentLinks-cache",
|
||||
"getHighlightsLinks-cache",
|
||||
"getHighlightsLinks-cache"
|
||||
]);
|
||||
let notifCount = 0;
|
||||
let observer = function(subject, topic, data) {
|
||||
|
@ -96,7 +96,7 @@ exports["test cache invalidation on history change"] = function*(assert) {
|
|||
|
||||
placesCachePromise = makeCachePromise("places");
|
||||
let visits = [
|
||||
{uri: NetUtil.newURI("https://example.com/"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example.com/"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED}
|
||||
];
|
||||
|
||||
yield PlacesTestUtils.addVisits(visits);
|
||||
|
@ -117,7 +117,7 @@ exports["test cache invalidation on blocklist change"] = function*(assert) {
|
|||
placesCachePromise = makeCachePromise("places");
|
||||
let visits = [
|
||||
{uri: NetUtil.newURI("https://example1.com/"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example2.com/"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example2.com/"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED}
|
||||
];
|
||||
|
||||
yield PlacesTestUtils.addVisits(visits);
|
||||
|
@ -213,7 +213,7 @@ exports["test rebuilds don't clobber each other"] = function*(assert) {
|
|||
{uri: NetUtil.newURI("https://example.com/1"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example.com/2"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example.com/3"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example.com/4"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example.com/4"), visitDate: (new Date()).getTime() * 1000, transition: PlacesUtils.TRANSITION_TYPED}
|
||||
];
|
||||
yield PlacesTestUtils.addVisits(visits);
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ exports["test ExperimentProvider only selects one experiment"] = assert => {
|
|||
name: "dachshund",
|
||||
control: {value: false},
|
||||
variant: {id: "dachshund_01", threshold: 0.2, value: true}
|
||||
},
|
||||
}
|
||||
}, randomNumber);
|
||||
assert.equal(experimentProvider.data.dachshund, true, "dachshund should be selected");
|
||||
assert.equal(experimentProvider.data.kitty, false, "kitty should not be selected");
|
||||
|
|
|
@ -73,7 +73,7 @@ function verifyPerfEvents(eventsArray, assert) {
|
|||
"HIGHLIGHTS_LINKS_REQUEST",
|
||||
"HIGHLIGHTS_LINKS_RESPONSE",
|
||||
"SEARCH_STATE_RESPONSE",
|
||||
"NOTIFY_PERFORMANCE",
|
||||
"NOTIFY_PERFORMANCE"
|
||||
]);
|
||||
|
||||
let expectedData = new Set([
|
||||
|
|
|
@ -43,7 +43,7 @@ exports.test_LinkChecker_securityCheck = function(assert) {
|
|||
{url: "about:newtab", expected: true},
|
||||
{url: "https://example.com", expected: true},
|
||||
{url: "ftp://example.com", expected: true},
|
||||
{url: "place:sort=foo", expected: false},
|
||||
{url: "place:sort=foo", expected: false}
|
||||
];
|
||||
for (let {url, expected} of urls) {
|
||||
let observed = PlacesProvider.LinkChecker.checkLoadURI(url);
|
||||
|
@ -84,7 +84,7 @@ exports.test_Links_getTopFrecentSites_Order = function*(assert) {
|
|||
// sort by last visit date, frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla3.com/2"), visitDate: timeLater, transition: TRANSITION_TYPED},
|
||||
// sort by frecency, frecency 10
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeLater, transition: TRANSITION_LINK},
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeLater, transition: TRANSITION_LINK}
|
||||
];
|
||||
|
||||
let links = yield provider.getTopFrecentSites();
|
||||
|
@ -115,7 +115,7 @@ exports.test_Links_getTopFrecentSites_Order = function*(assert) {
|
|||
exports.test_Links_getHighlightsLinks = function*(assert) {
|
||||
let provider = PlacesProvider.links;
|
||||
let {
|
||||
TRANSITION_TYPED,
|
||||
TRANSITION_TYPED
|
||||
} = PlacesUtils.history;
|
||||
|
||||
let timeToday = timeDaysAgo(0);
|
||||
|
@ -125,7 +125,7 @@ exports.test_Links_getHighlightsLinks = function*(assert) {
|
|||
{uri: NetUtil.newURI("https://example1.com/"), visitDate: timeToday, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example2.com/"), visitDate: timeToday, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example3.com/"), visitDate: timeEarlier, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://mail.google.com/"), visitDate: timeEarlier, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://mail.google.com/"), visitDate: timeEarlier, transition: TRANSITION_TYPED}
|
||||
];
|
||||
|
||||
let links = yield provider.getHighlightsLinks();
|
||||
|
@ -155,7 +155,7 @@ exports.test_Links_getRecentLinks = function*(assert) {
|
|||
// sort by last visit date, frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla3.com/2"), visitDate: timeDaysAgo(2), transition: TRANSITION_TYPED},
|
||||
// sort by frecency, frecency 10
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeDaysAgo(2), transition: TRANSITION_LINK},
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeDaysAgo(2), transition: TRANSITION_LINK}
|
||||
];
|
||||
|
||||
let links = yield provider.getRecentLinks();
|
||||
|
@ -219,7 +219,7 @@ exports.test_Links_getFrecentLinks = function*(assert) {
|
|||
// sort by last visit date, frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla3.com/2"), visitDate: timeDaysAgo(4), transition: TRANSITION_TYPED},
|
||||
// sort by frecency, frecency 10
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeDaysAgo(0), transition: TRANSITION_LINK},
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeDaysAgo(0), transition: TRANSITION_LINK}
|
||||
];
|
||||
|
||||
let bookmarkItem = {url: "https://mozilla5.com/4", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK};
|
||||
|
@ -266,7 +266,7 @@ exports.test_Links_asyncDeleteBookmark = function*(assert) {
|
|||
|
||||
let bookmarks = [
|
||||
{url: "https://mozilla1.com/0", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/1", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/1", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK}
|
||||
];
|
||||
|
||||
let links = yield provider.getRecentBookmarks();
|
||||
|
@ -304,7 +304,7 @@ exports.test_Links_deleteHistoryLink = function*(assert) {
|
|||
// frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla1.com/0"), visitDate: timeDaysAgo(1), transition: TRANSITION_TYPED},
|
||||
// sort by url, frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla2.com/1"), visitDate: timeDaysAgo(0), transition: TRANSITION_LINK},
|
||||
{uri: NetUtil.newURI("https://mozilla2.com/1"), visitDate: timeDaysAgo(0), transition: TRANSITION_LINK}
|
||||
];
|
||||
|
||||
let links = yield provider.getRecentLinks();
|
||||
|
@ -347,13 +347,13 @@ exports.test_Links_getRecentBookmarks_Order = function*(assert) {
|
|||
// sort by last visit date, frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla3.com/2"), visitDate: timeLater, transition: TRANSITION_TYPED},
|
||||
// sort by frecency, frecency 10
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeLater, transition: TRANSITION_LINK},
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeLater, transition: TRANSITION_LINK}
|
||||
];
|
||||
|
||||
let bookmarks = [
|
||||
{url: "https://mozilla1.com/0", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/1", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/2", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/2", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK}
|
||||
];
|
||||
|
||||
let bookmarkURLSet = new Set(bookmarks.map(bm => bm.url));
|
||||
|
@ -369,7 +369,7 @@ exports.test_Links_getRecentBookmarks_Order = function*(assert) {
|
|||
let faviconData = {
|
||||
"https://mozilla1.com/0": null,
|
||||
"https://mozilla2.com/1": null,
|
||||
"https://mozilla3.com/2": base64URL,
|
||||
"https://mozilla3.com/2": base64URL
|
||||
};
|
||||
yield PlacesTestUtils.addVisits(visits);
|
||||
yield PlacesTestUtils.addFavicons(faviconData);
|
||||
|
@ -474,13 +474,13 @@ exports.test_Links_bookmark_notifications = function*(assert) {
|
|||
// sort by last visit date, frecency 200
|
||||
{uri: NetUtil.newURI("https://mozilla3.com/2"), visitDate: timeLater, transition: TRANSITION_TYPED},
|
||||
// sort by frecency, frecency 10
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeLater, transition: TRANSITION_LINK},
|
||||
{uri: NetUtil.newURI("https://mozilla4.com/3"), visitDate: timeLater, transition: TRANSITION_LINK}
|
||||
];
|
||||
|
||||
let bookmarks = [
|
||||
{url: "https://mozilla1.com/0", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/1", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/2", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
|
||||
{url: "https://mozilla1.com/2", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK}
|
||||
];
|
||||
|
||||
let links = yield provider.getRecentBookmarks();
|
||||
|
@ -492,7 +492,7 @@ exports.test_Links_bookmark_notifications = function*(assert) {
|
|||
let faviconData = {
|
||||
"https://mozilla1.com/0": null,
|
||||
"https://mozilla2.com/1": null,
|
||||
"https://mozilla3.com/2": base64URL,
|
||||
"https://mozilla3.com/2": base64URL
|
||||
};
|
||||
yield PlacesTestUtils.addVisits(visits);
|
||||
yield PlacesTestUtils.addFavicons(faviconData);
|
||||
|
@ -692,7 +692,7 @@ exports.test_Links_getHistorySize = function*(assert) {
|
|||
exports.test_blocked_urls = function*(assert) {
|
||||
let provider = PlacesProvider.links;
|
||||
let {
|
||||
TRANSITION_TYPED,
|
||||
TRANSITION_TYPED
|
||||
} = PlacesUtils.history;
|
||||
|
||||
let timeToday = timeDaysAgo(0);
|
||||
|
@ -702,7 +702,7 @@ exports.test_blocked_urls = function*(assert) {
|
|||
{uri: NetUtil.newURI("https://example1.com/"), visitDate: timeToday, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example2.com/"), visitDate: timeToday, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example3.com/"), visitDate: timeEarlier, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example4.com/"), visitDate: timeEarlier, transition: TRANSITION_TYPED},
|
||||
{uri: NetUtil.newURI("https://example4.com/"), visitDate: timeEarlier, transition: TRANSITION_TYPED}
|
||||
];
|
||||
yield PlacesTestUtils.addVisits(visits);
|
||||
yield Bookmarks.insert({url: "https://example5.com/", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK});
|
||||
|
|
|
@ -88,7 +88,7 @@ exports.test_filter_urls = function(assert) {
|
|||
{"url": "http://0.0.0.0", "title": "blah"},
|
||||
{"url": null, "title": "blah"}
|
||||
];
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
// all valid urls should be allowed through the filter and should be returned
|
||||
|
|
|
@ -15,7 +15,7 @@ let fakeResponse = {"urls": [
|
|||
{url: "http://example.com/2"},
|
||||
{url: "http://example.com/3"},
|
||||
{url: "http://example.com/4"},
|
||||
{url: "http://example.com/5"},
|
||||
{url: "http://example.com/5"}
|
||||
]};
|
||||
|
||||
exports.test_get_recommended_content = function*(assert) {
|
||||
|
|
|
@ -49,7 +49,7 @@ module.exports = {
|
|||
},
|
||||
output: {
|
||||
path: outputDir,
|
||||
filename: outputFilename,
|
||||
filename: outputFilename
|
||||
},
|
||||
target: "web",
|
||||
resolve: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче