From a7bf5c2df90b49f4849151489954ed5b7aea3e54 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Thu, 21 Dec 2017 16:34:11 +0000 Subject: [PATCH] ChromeOsAssistant: Add assistant for ChromeOS --- wa/framework/target/assistant.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/wa/framework/target/assistant.py b/wa/framework/target/assistant.py index f23a08b7..599c719b 100644 --- a/wa/framework/target/assistant.py +++ b/wa/framework/target/assistant.py @@ -151,3 +151,30 @@ class LogcatPoller(threading.Thread): self.last_poll = time.time() self.target.dump_logcat(self.buffer_file, append=True, timeout=self.timeout) self.target.clear_logcat() + + +class ChromeOsAssistant(LinuxAssistant): + + parameters = LinuxAssistant.parameters + AndroidAssistant.parameters + + def __init__(self, target, logcat_poll_period=None): + super(ChromeOsAssistant, self).__init__(target) + if target.supports_android: + self.android_assistant = AndroidAssistant(target.android_container, logcat_poll_period) + else: + self.android_assistant = None + + def start(self): + super(ChromeOsAssistant, self).start() + if self.android_assistant: + self.android_assistant.start() + + def extract_results(self, context): + super(ChromeOsAssistant, self).extract_results(context) + if self.android_assistant: + self.android_assistant.extract_results(context) + + def stop(self): + super(ChromeOsAssistant, self).stop() + if self.android_assistant: + self.android_assistant.stop()