Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 | ]; |