toolkit/components/places/tests/autocomplete/test_download_embed_bookmarks.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_download_embed_bookmarks.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim:set ts=2 sw=2 sts=2 et:
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +/**
    1.11 + * Tests bug 449406 to ensure that TRANSITION_DOWNLOAD, TRANSITION_EMBED and
    1.12 + * TRANSITION_FRAMED_LINK bookmarked uri's show up in the location bar.
    1.13 + */
    1.14 +
    1.15 +// Define some shared uris and titles (each page needs its own uri)
    1.16 +let kURIs = [
    1.17 +  "http://download/bookmarked",
    1.18 +  "http://embed/bookmarked",
    1.19 +  "http://framed/bookmarked",
    1.20 +  "http://download",
    1.21 +  "http://embed",
    1.22 +  "http://framed",
    1.23 +];
    1.24 +let kTitles = [
    1.25 +  "download-bookmark",
    1.26 +  "embed-bookmark",
    1.27 +  "framed-bookmark",
    1.28 +  "download2",
    1.29 +  "embed2",
    1.30 +  "framed2",
    1.31 +];
    1.32 +
    1.33 +// Add download and embed uris
    1.34 +addPageBook(0, 0, 0, undefined, undefined, TRANSITION_DOWNLOAD);
    1.35 +addPageBook(1, 1, 1, undefined, undefined, TRANSITION_EMBED);
    1.36 +addPageBook(2, 2, 2, undefined, undefined, TRANSITION_FRAMED_LINK);
    1.37 +addPageBook(3, 3, undefined, undefined, undefined, TRANSITION_DOWNLOAD);
    1.38 +addPageBook(4, 4, undefined, undefined, undefined, TRANSITION_EMBED);
    1.39 +addPageBook(5, 5, undefined, undefined, undefined, TRANSITION_FRAMED_LINK);
    1.40 +
    1.41 +// Provide for each test: description; search terms; array of gPages indices of
    1.42 +// pages that should match; optional function to be run before the test
    1.43 +let gTests = [
    1.44 +  ["0: Searching for bookmarked download uri matches",
    1.45 +   kTitles[0], [0]],
    1.46 +  ["1: Searching for bookmarked embed uri matches",
    1.47 +   kTitles[1], [1]],
    1.48 +  ["2: Searching for bookmarked framed uri matches",
    1.49 +   kTitles[2], [2]],
    1.50 +  ["3: Searching for download uri does not match",
    1.51 +   kTitles[3], []],
    1.52 +  ["4: Searching for embed uri does not match",
    1.53 +   kTitles[4], []],
    1.54 +  ["5: Searching for framed uri does not match",
    1.55 +   kTitles[5], []],
    1.56 +];

mercurial