toolkit/components/places/tests/autocomplete/test_418257.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_418257.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     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 bug 418257 by making sure tags are returned with the title as part of
    1.10 + * the "comment" if there are tags even if we didn't match in the tags. They
    1.11 + * are separated from the title by a endash.
    1.12 + */
    1.13 +
    1.14 +// Define some shared uris and titles (each page needs its own uri)
    1.15 +let kURIs = [
    1.16 +  "http://page1",
    1.17 +  "http://page2",
    1.18 +  "http://page3",
    1.19 +  "http://page4",
    1.20 +];
    1.21 +let kTitles = [
    1.22 +  "tag1",
    1.23 +  "tag2",
    1.24 +  "tag3",
    1.25 +];
    1.26 +
    1.27 +// Add pages with varying number of tags
    1.28 +addPageBook(0, 0, 0, [0]);
    1.29 +addPageBook(1, 0, 0, [0,1]);
    1.30 +addPageBook(2, 0, 0, [0,2]);
    1.31 +addPageBook(3, 0, 0, [0,1,2]);
    1.32 +
    1.33 +// Provide for each test: description; search terms; array of gPages indices of
    1.34 +// pages that should match; optional function to be run before the test
    1.35 +let gTests = [
    1.36 +  ["0: Make sure tags come back in the title when matching tags",
    1.37 +   "page1 tag", [0]],
    1.38 +  ["1: Check tags in title for page2",
    1.39 +   "page2 tag", [1]],
    1.40 +  ["2: Make sure tags appear even when not matching the tag",
    1.41 +   "page3", [2]],
    1.42 +  ["3: Multiple tags come in commas for page4",
    1.43 +   "page4", [3]],
    1.44 +  ["4: Extra test just to make sure we match the title",
    1.45 +   "tag2", [1,3]],
    1.46 +];

mercurial