2012-05-21 04:12:37 -07:00
|
|
|
/* 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
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-02-23 16:54:19 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test for bug 417798 to make sure javascript: URIs don't show up unless the
|
|
|
|
* user searches for javascript: explicitly.
|
|
|
|
*/
|
|
|
|
|
2008-03-13 22:01:39 -07:00
|
|
|
// Define some shared uris and titles (each page needs its own uri)
|
2008-02-23 16:54:19 -08:00
|
|
|
let kURIs = [
|
|
|
|
"http://abc/def",
|
|
|
|
"javascript:5",
|
|
|
|
];
|
|
|
|
let kTitles = [
|
|
|
|
"Title with javascript:",
|
|
|
|
];
|
|
|
|
|
2008-03-13 22:01:39 -07:00
|
|
|
addPageBook(0, 0); // regular url
|
2010-11-09 11:43:18 -08:00
|
|
|
// javascript: uri as bookmark (no visit)
|
|
|
|
addPageBook(1, 0, 0, undefined, undefined, undefined, true);
|
2008-02-23 16:54:19 -08:00
|
|
|
|
2008-04-12 10:14:45 -07:00
|
|
|
// Provide for each test: description; search terms; array of gPages indices of
|
|
|
|
// pages that should match; optional function to be run before the test
|
2008-02-23 16:54:19 -08:00
|
|
|
let gTests = [
|
|
|
|
["0: Match non-javascript: with plain search",
|
2008-04-12 00:32:57 -07:00
|
|
|
"a", [0]],
|
2008-02-23 16:54:19 -08:00
|
|
|
["1: Match non-javascript: with almost javascript:",
|
2008-04-12 00:32:57 -07:00
|
|
|
"javascript", [0]],
|
2008-02-23 16:54:19 -08:00
|
|
|
["2: Match javascript:",
|
2008-04-12 00:32:57 -07:00
|
|
|
"javascript:", [0,1]],
|
2008-02-23 16:54:19 -08:00
|
|
|
["3: Match nothing with non-first javascript:",
|
|
|
|
"5 javascript:", []],
|
|
|
|
["4: Match javascript: with multi-word search",
|
2008-04-12 00:32:57 -07:00
|
|
|
"javascript: 5", [1]],
|
2008-02-23 16:54:19 -08:00
|
|
|
];
|