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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/places/tests/autocomplete/test_416214.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +/*
     1.9 + * Test autocomplete for non-English URLs that match the tag bug 416214. Also
    1.10 + * test bug 417441 by making sure escaped ascii characters like "+" remain
    1.11 + * escaped.
    1.12 + *
    1.13 + * - add a visit for a page with a non-English URL
    1.14 + * - add a tag for the page
    1.15 + * - search for the tag
    1.16 + * - test number of matches (should be exactly one)
    1.17 + * - make sure the url is decoded
    1.18 + */
    1.19 +
    1.20 +let theTag = "superTag";
    1.21 +
    1.22 +// Define some shared uris and titles (each page needs its own uri)
    1.23 +let kURIs = [
    1.24 +  "http://escaped/ユニコード",
    1.25 +  "http://asciiescaped/blocking-firefox3%2B",
    1.26 +];
    1.27 +let kTitles = [
    1.28 +  "title",
    1.29 +  theTag,
    1.30 +];
    1.31 +
    1.32 +// Add pages that match the tag
    1.33 +addPageBook(0, 0, 0, [1]);
    1.34 +addPageBook(1, 0, 0, [1]);
    1.35 +
    1.36 +// Provide for each test: description; search terms; array of gPages indices of
    1.37 +// pages that should match; optional function to be run before the test
    1.38 +let gTests = [
    1.39 +  ["0: Make sure tag matches return the right url as well as '+' remain escaped",
    1.40 +   theTag, [0,1]],
    1.41 +];

mercurial