|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* Any copyright is dedicated to the Public Domain. |
|
4 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
5 "use strict"; |
|
6 |
|
7 //////////////////////////////////////////////////////////////////////////////// |
|
8 //// Globals |
|
9 |
|
10 Components.utils.import("resource://services-sync/main.js"); |
|
11 //////////////////////////////////////////////////////////////////////////////// |
|
12 //// Test(s) |
|
13 |
|
14 function test() { |
|
15 runTests(); |
|
16 } |
|
17 |
|
18 gTests.push({ |
|
19 desc: "Test sync tabs from other devices UI", |
|
20 run: function run() { |
|
21 if (BrowserUI.isStartTabVisible) |
|
22 return; |
|
23 |
|
24 yield addTab("about:start"); |
|
25 yield waitForCondition(() => BrowserUI.isStartTabVisible); |
|
26 yield hideContextUI(); |
|
27 |
|
28 is(Weave.Status.checkSetup(), Weave.CLIENT_NOT_CONFIGURED, "Sync should be disabled on start"); |
|
29 |
|
30 let vbox = Browser.selectedBrowser.contentDocument.getElementById("start-remotetabs"); |
|
31 ok(vbox.hidden, "remote tabs in the start page should be hidden when sync is not enabled"); |
|
32 |
|
33 Browser.selectedBrowser.contentWindow.RemoteTabsStartView._view.setUIAccessVisible(true); |
|
34 |
|
35 // start page grid should be visible |
|
36 ok(vbox, "remote tabs grid is present on start page"); |
|
37 is(vbox.hidden, false, "remote tabs should be visible in start page when sync is enabled"); |
|
38 |
|
39 Browser.selectedBrowser.contentWindow.RemoteTabsStartView._view.setUIAccessVisible(false); |
|
40 |
|
41 ok(vbox.hidden, "remote tabs in the start page should be hidden when sync is not enabled"); |
|
42 } |
|
43 }); |