on xenial help sign in
review comments
35f9f7cNick Dedekind
data/indicators-client.desktop.in+1−1
@@ -1,7 +1,7 @@
1[Desktop Entry]
1[Desktop Entry]
2Type=Application
2Type=Application
3Name=Indicators Client
3Name=Indicators Client
4−Comment=An interface for using the Scopes system
4+Comment=Application for testing the Indicators system
5Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/indicators-client
5Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/indicators-client
6Terminal=false
6Terminal=false
7Icon=
7Icon=
tests/autopilot/unity8/fixture_setup.py+11−9
@@ -19,6 +19,7 @@
19
19
20import fixtures
20import fixtures
21import subprocess
21import subprocess
22+import logging
22
23
23from autopilot import introspection
24from autopilot import introspection
24
25
@@ -28,6 +29,7 @@ from unity8 import (
28)
29)
29from unity8.shell import emulators
30from unity8.shell import emulators
30
31
32+logger = logging.getLogger(__name__)
31
33
32class LaunchDashApp(fixtures.Fixture):
34class LaunchDashApp(fixtures.Fixture):
33
35
@@ -104,16 +106,17 @@ class LaunchMockIndicatorService(fixtures.Fixture):
104
106
105 """Fixture to launch the indicator test service."""
107 """Fixture to launch the indicator test service."""
106
108
107− def __init__(self, variables, ensure_not_running=True):
109+ def __init__(self, action_delay, ensure_not_running=True):
108 """Initialize an instance.
110 """Initialize an instance.
109
111
110− :param variables: The variables to use when launching the app.
112+ :param action_delay: The delay to use when activating actions.
111− :type variables: A dictionary.
113+ Measured in milliseconds. Value of -1 will result in infinite delay.
114+ :type action_delay: An integer.
112 :param boolean ensure_not_running: Make sure service is not running
115 :param boolean ensure_not_running: Make sure service is not running
113
116
114 """
117 """
115 super(LaunchMockIndicatorService, self).__init__()
118 super(LaunchMockIndicatorService, self).__init__()
116− self.variables = variables
119+ self.action_delay = action_delay
117 self.ensure_not_running = ensure_not_running
120 self.ensure_not_running = ensure_not_running
118
121
119 def setUp(self):
122 def setUp(self):
@@ -124,16 +127,15 @@ class LaunchMockIndicatorService(fixtures.Fixture):
124 self.application_proxy = self.launch_service()
127 self.application_proxy = self.launch_service()
125
128
126 def launch_service(self):
129 def launch_service(self):
130+ logger.info("Starting unity-mock-indicator-service")
127 binary_path = get_binary_path('unity-mock-indicator-service')
131 binary_path = get_binary_path('unity-mock-indicator-service')
128 binary_arg = 'BINARY={}'.format(binary_path)
132 binary_arg = 'BINARY={}'.format(binary_path)
129− testability_arg = 'QT_LOAD_TESTABILITY={}'.format(1)
133+ env_args = 'ARGS=-t {}'.format(self.action_delay)
130− env_args = [
131− '{}={}'.format(key, value) for key, value in self.variables.items()
132− ]
133− all_args = [binary_arg, testability_arg] + env_args
134+ all_args = [binary_arg, env_args]
134 process_helpers.start_job('unity-mock-indicator-service', *all_args)
135 process_helpers.start_job('unity-mock-indicator-service', *all_args)
135
136
136 def stop_service(self):
137 def stop_service(self):
138+ logger.info("Stopping unity-mock-indicator-service")
137 process_helpers.stop_job('unity-mock-indicator-service')
139 process_helpers.stop_job('unity-mock-indicator-service')
138
140
139 def ensure_service_not_running(self):
141 def ensure_service_not_running(self):
tests/autopilot/unity8/indicators/tests/test_action_latency.py+8−11
@@ -38,10 +38,7 @@ class TestIndicatorBaseTestCase(tests.IndicatorTestCase):
38 def setUp(self):
38 def setUp(self):
39 super(TestIndicatorBaseTestCase, self).setUp()
39 super(TestIndicatorBaseTestCase, self).setUp()
40
40
41− environment = {}
42− environment['ARGS'] = '-t {0}'\
43− .format(self.action_delay)
44− self.launch_indicator_service(environment)
41+ self.launch_indicator_service()
45
42
46 # wait for the indicator to appear in unity
43 # wait for the indicator to appear in unity
47 self.indicator = indicators.TestIndicator(self.main_window)
44 self.indicator = indicators.TestIndicator(self.main_window)
@@ -51,8 +48,8 @@ class TestIndicatorBaseTestCase(tests.IndicatorTestCase):
51 )
48 )
52 self.indicator_page = self.indicator.open()
49 self.indicator_page = self.indicator.open()
53
50
54− def launch_indicator_service(self, variables):
51+ def launch_indicator_service(self):
55− launch_service_fixture = fixture_setup.LaunchMockIndicatorService(variables)
52+ launch_service_fixture = fixture_setup.LaunchMockIndicatorService(self.action_delay)
56 self.useFixture(launch_service_fixture)
53 self.useFixture(launch_service_fixture)
57
54
58
55
@@ -61,9 +58,9 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
61 """Test that an action causes the server to update"""
58 """Test that an action causes the server to update"""
62
59
63 time_scenarios = [
60 time_scenarios = [
64− ('Low', dict(action_delay=0)),
61+ ('Low', {'action_delay': 0}),
65− ('Medium', dict(action_delay=2500)),
62+ ('Medium', {'action_delay': 2500}),
66− ('High', dict(action_delay=8000)),
63+ ('High', {'action_delay': 8000}),
67 ]
64 ]
68 scenarios = multiply_scenarios(
65 scenarios = multiply_scenarios(
69 time_scenarios,
66 time_scenarios,
@@ -106,7 +103,7 @@ class TestBuffering(TestIndicatorBaseTestCase):
106 """
103 """
107 action_delay = 2500
104 action_delay = 2500
108
105
109− def test_buffered_switch(self):
106+ def test_switch_buffers_actvations(self):
110
107
111 switch = self.indicator_page.get_switcher()
108 switch = self.indicator_page.get_switcher()
112 switch.change_state()
109 switch.change_state()
@@ -142,7 +139,7 @@ class TestBuffering(TestIndicatorBaseTestCase):
142 Equals(switch_menu.serverChecked)
139 Equals(switch_menu.serverChecked)
143 )
140 )
144
141
145− def test_buffered_slider(self):
142+ def test_slider_buffers_activations(self):
146
143
147 slider = self.indicator_page.get_slider()
144 slider = self.indicator_page.get_slider()
148 original_value = slider.value;
145 original_value = slider.value;
tests/mocks/indicator-service/CMakeLists.txt+1−5
@@ -8,12 +8,8 @@ include_directories(
8 ${GIO_INCLUDE_DIRS}
8 ${GIO_INCLUDE_DIRS}
9)
9)
10
10
11−set(MOCK_INDICATOR_SERVICE_SRC
12− mock-indicator-service.c
13−)
14−
15add_executable(${MOCK_INDICATOR_SERVICE_APP}
11add_executable(${MOCK_INDICATOR_SERVICE_APP}
16− ${MOCK_INDICATOR_SERVICE_SRC}
12+ mock-indicator-service.c
17)
13)
18
14
19target_link_libraries(${MOCK_INDICATOR_SERVICE_APP} ${GIO_LDFLAGS})
15target_link_libraries(${MOCK_INDICATOR_SERVICE_APP} ${GIO_LDFLAGS})