Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
/**
* the page title, page url, or bookmark title to be considered a match. All
* terms must match but not all terms need to be in the title, etc.
*
* page title and partially in the bookmark.
*/
// Define some shared uris and titles (each page needs its own uri)
var kURIs = [
];
var kTitles = [
"f(o)o b<a>r",
"b(a)r b<a>z",
];
// Regular pages
addPageBook(0, 0);
addPageBook(1, 1);
// Bookmarked pages
addPageBook(2, 0, 0);
addPageBook(3, 0, 1);
// Provide for each test: description; search terms; array of gPages indices of
// pages that should match; optional function to be run before the test
var gTests = [
["0: Match 2 terms all in url",
"c d", [0]],
["1: Match 1 term in url and 1 term in title",
"b e", [0, 1]],
["2: Match 3 terms all in title; display bookmark title if matched",
"b a z", [1, 3]],
["3: Match 2 terms in url and 1 in title; make sure bookmark title is used for search",
"k f t", [2]],
["4: Match 3 terms in url and 1 in title",
"d i g z", [1]],
["5: Match nothing",
"m o z i", []],
];