toolkit/components/places/tests/autocomplete/test_416214.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 /*
michael@0 6 * Test autocomplete for non-English URLs that match the tag bug 416214. Also
michael@0 7 * test bug 417441 by making sure escaped ascii characters like "+" remain
michael@0 8 * escaped.
michael@0 9 *
michael@0 10 * - add a visit for a page with a non-English URL
michael@0 11 * - add a tag for the page
michael@0 12 * - search for the tag
michael@0 13 * - test number of matches (should be exactly one)
michael@0 14 * - make sure the url is decoded
michael@0 15 */
michael@0 16
michael@0 17 let theTag = "superTag";
michael@0 18
michael@0 19 // Define some shared uris and titles (each page needs its own uri)
michael@0 20 let kURIs = [
michael@0 21 "http://escaped/ユニコード",
michael@0 22 "http://asciiescaped/blocking-firefox3%2B",
michael@0 23 ];
michael@0 24 let kTitles = [
michael@0 25 "title",
michael@0 26 theTag,
michael@0 27 ];
michael@0 28
michael@0 29 // Add pages that match the tag
michael@0 30 addPageBook(0, 0, 0, [1]);
michael@0 31 addPageBook(1, 0, 0, [1]);
michael@0 32
michael@0 33 // Provide for each test: description; search terms; array of gPages indices of
michael@0 34 // pages that should match; optional function to be run before the test
michael@0 35 let gTests = [
michael@0 36 ["0: Make sure tag matches return the right url as well as '+' remain escaped",
michael@0 37 theTag, [0,1]],
michael@0 38 ];

mercurial