2
# This file is part of Checkbox.
4
# Copyright 2013 Canonical Ltd.
6
# Checkbox is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License version 3,
8
# as published by the Free Software Foundation.
11
# Checkbox is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
22
from checkbox.scripts.audio_settings import _guess_hdmi_profile
23
from checkbox.parsers.tests.test_pactl import PactlDataMixIn
26
class SetProfileTest(unittest.TestCase, PactlDataMixIn):
28
def test_desktop_precise_xps1340(self):
30
Precise system with a Nvidia chipset.
31
HDMI is present in the card ports list but not shown in the sinks list.
32
The port availability cannot be determined, in that case the expected
33
value is the first stereo profile listed in the identified port.
40
hdmi-output-0: HDMI / DisplayPort (priority 5900)
41
Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo
44
_guess_hdmi_profile(self.get_text("desktop-precise-xps1340")),
45
('0', 'output:hdmi-stereo'))
47
def test_desktop_precise_radeon_not_available(self):
49
Home-made system running Precise with a Radeon card.
50
HDMI is present in the card ports list and shown in the sinks list.
51
But the port is "not available", both card and profile should be set
58
hdmi-output-0: HDMI / DisplayPort (priority: 5900, not available)
63
hdmi-output-0: HDMI / DisplayPort (priority 5900)
64
Part of profile(s): output:hdmi-stereo
67
_guess_hdmi_profile(self.get_text("desktop-precise-radeon")),
70
def test_desktop_precise_radeon_available(self):
72
Home-made system running Precise with a Radeon card.
73
HDMI is present in the card ports list, shown in the sinks list and
74
marked as "available", in that case the expected value is the first
75
stereo profile listed in the identified port.
81
hdmi-output-0: HDMI / DisplayPort (priority: 5900, available)
86
hdmi-output-0: HDMI / DisplayPort (priority 5900)
87
Part of profile(s): output:hdmi-stereo
90
_guess_hdmi_profile(self.get_text(
91
"desktop-precise-radeon-hdmi-available")),
92
('0', 'output:hdmi-stereo'))
94
def test_desktop_raring_t430s_not_available(self):
96
Raring system with a Mini-DisplayPort.
97
DisplayPort is present in the card ports list but marked as
98
"not available". Thus both card and profile should be set
106
hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)
108
device.icon_name = "video-display"
109
Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
110
hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
112
device.icon_name = "video-display"
113
Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo
114
hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
116
device.icon_name = "video-display"
117
Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo
120
_guess_hdmi_profile(self.get_text("desktop-raring-t430s")),
123
def test_desktop_raring_t430s_available(self):
125
Raring system with a Mini-DisplayPort.
126
DisplayPort is present in the card ports list and marked as
127
"available", in that case the expected value is the first stereo
128
profile listed in the identified port.
135
hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, available)
137
device.icon_name = "video-display"
138
Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
139
hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
141
device.icon_name = "video-display"
142
Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo
143
hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
145
device.icon_name = "video-display"
146
Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo
149
_guess_hdmi_profile(self.get_text(
150
"desktop-raring-t430s-dp-available")),
151
('2', 'output:hdmi-stereo'))