|
1 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * vim:set ts=2 sw=2 sts=2 et: |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 /** |
|
8 * Tests bug 449406 to ensure that TRANSITION_DOWNLOAD, TRANSITION_EMBED and |
|
9 * TRANSITION_FRAMED_LINK bookmarked uri's show up in the location bar. |
|
10 */ |
|
11 |
|
12 // Define some shared uris and titles (each page needs its own uri) |
|
13 let kURIs = [ |
|
14 "http://download/bookmarked", |
|
15 "http://embed/bookmarked", |
|
16 "http://framed/bookmarked", |
|
17 "http://download", |
|
18 "http://embed", |
|
19 "http://framed", |
|
20 ]; |
|
21 let kTitles = [ |
|
22 "download-bookmark", |
|
23 "embed-bookmark", |
|
24 "framed-bookmark", |
|
25 "download2", |
|
26 "embed2", |
|
27 "framed2", |
|
28 ]; |
|
29 |
|
30 // Add download and embed uris |
|
31 addPageBook(0, 0, 0, undefined, undefined, TRANSITION_DOWNLOAD); |
|
32 addPageBook(1, 1, 1, undefined, undefined, TRANSITION_EMBED); |
|
33 addPageBook(2, 2, 2, undefined, undefined, TRANSITION_FRAMED_LINK); |
|
34 addPageBook(3, 3, undefined, undefined, undefined, TRANSITION_DOWNLOAD); |
|
35 addPageBook(4, 4, undefined, undefined, undefined, TRANSITION_EMBED); |
|
36 addPageBook(5, 5, undefined, undefined, undefined, TRANSITION_FRAMED_LINK); |
|
37 |
|
38 // Provide for each test: description; search terms; array of gPages indices of |
|
39 // pages that should match; optional function to be run before the test |
|
40 let gTests = [ |
|
41 ["0: Searching for bookmarked download uri matches", |
|
42 kTitles[0], [0]], |
|
43 ["1: Searching for bookmarked embed uri matches", |
|
44 kTitles[1], [1]], |
|
45 ["2: Searching for bookmarked framed uri matches", |
|
46 kTitles[2], [2]], |
|
47 ["3: Searching for download uri does not match", |
|
48 kTitles[3], []], |
|
49 ["4: Searching for embed uri does not match", |
|
50 kTitles[4], []], |
|
51 ["5: Searching for framed uri does not match", |
|
52 kTitles[5], []], |
|
53 ]; |