From 2833953f2801db694654ca1297dcc17fe383152e Mon Sep 17 00:00:00 2001 From: Marek Ruszczak Date: Fri, 23 Sep 2011 17:19:33 +0300 Subject: [PATCH] Adding test for detcting unexpected GL context in boosters. --- tests/harmattan/red-tests/tests.xml | 16 ++++++++++ .../testscripts/test-func-launcher.py | 31 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/tests/harmattan/red-tests/tests.xml b/tests/harmattan/red-tests/tests.xml index 2468b8a..eeea48e 100644 --- a/tests/harmattan/red-tests/tests.xml +++ b/tests/harmattan/red-tests/tests.xml @@ -46,6 +46,22 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_wm_class_q + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_q_booster_dont_have_GL_context + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_m_booster_dont_have_GL_context + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_e_booster_dont_have_GL_context + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_d_booster_dont_have_GL_context + + true true diff --git a/tests/harmattan/testscripts/test-func-launcher.py b/tests/harmattan/testscripts/test-func-launcher.py index 6da7a94..be86085 100644 --- a/tests/harmattan/testscripts/test-func-launcher.py +++ b/tests/harmattan/testscripts/test-func-launcher.py @@ -67,6 +67,15 @@ class daemon_handling (unittest.TestCase): def start_daemons(self): start_daemons() +def has_GL_context(processId): + processMapsFile = open("/proc/" + processId + "/maps") + processMapsLines = processMapsFile.readlines() + for i in processMapsLines : + if "/dev/pvrsrvkm" in i : + return True + + return False + class launcher_tests (unittest.TestCase): def setUp(self): if daemons_running(): @@ -897,6 +906,28 @@ class launcher_tests (unittest.TestCase): for property in xProperties: self.assert_(op1 == wm_class_xproperty_string,'Application WM_CLASS 1 is incorrect: %s' %property) + + def test_q_booster_dont_have_GL_context(self): + qpid = get_pid('booster-q') + self.assert_(qpid != None, "Process 'booster-q' is not running") + self.assert_(not has_GL_context(qpid), "booster-q has GL context!") + + def test_m_booster_dont_have_GL_context(self): + mpid = get_pid('booster-m') + self.assert_(mpid != None, "Process 'booster-m' is not running") + self.assert_(not has_GL_context(mpid), "booster-m has GL context!") + + def test_e_booster_dont_have_GL_context(self): + epid = get_pid('booster-e') + self.assert_(epid != None, "Process 'booster-e' is not running") + self.assert_(not has_GL_context(epid), "booster-e has GL context!") + + def test_d_booster_dont_have_GL_context(self): + dpid = get_pid('booster-d') + self.assert_(dpid != None, "Process 'booster-d' is not running") + self.assert_(not has_GL_context(dpid), "booster-d has GL context!") + + # main if __name__ == '__main__': # When run with testrunner, for some reason the PATH doesn't include