Chameleon: Implement display_HotPlugAtSuspend test
This change implements the display_HotPlugAtSuspend test which remotely
emulates external display hot-plug during suspend using Chameleon board.
The configs it tests are:
(plugged_before_suspend, plugged_after_suspend, plugged_before_resume):
(True, True, True)
(True, False, False)
(True, False, True)
(False, True, True)
(False, True, False)
It verifies DUT behavior response to these configs.
BUG=chromium:343790
TEST=manaul
$ test_that --fast --args "chameleon_host=$CHAMELEON_IP" $DUT_IP \
e:display_HotPlugAtSuspend.*
Change-Id: I1b8515c7cebbb56e8a2290d6014947aabc046794
Reviewed-on: https://chromium-review.googlesource.com/186347
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Wai-Hong Tam <waihong@chromium.org>
Tested-by: Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/chameleon/display_client.py b/server/cros/chameleon/display_client.py
index 27ee84b..e36f95d 100644
--- a/server/cros/chameleon/display_client.py
+++ b/server/cros/chameleon/display_client.py
@@ -122,10 +122,22 @@
return self._display_xmlrpc_client.set_mirrored(is_mirrored)
- def suspend_resume(self):
- """Suspends the DUT for 10 seconds."""
+ def suspend_resume(self, suspend_time=10):
+ """Suspends the DUT for a given time in second.
+
+ @param suspend_time: Suspend time in second, default: 10s.
+ """
# TODO(waihong): Use other general API instead of this RPC.
- return self._display_xmlrpc_client.suspend_resume()
+ return self._display_xmlrpc_client.suspend_resume(suspend_time)
+
+
+ def suspend_resume_bg(self, suspend_time=10):
+ """Suspends the DUT for a given time in second in the background.
+
+ @param suspend_time: Suspend time in second, default: 10s.
+ """
+ # TODO(waihong): Use other general API instead of this RPC.
+ return self._display_xmlrpc_client.suspend_resume_bg(suspend_time)
def reconnect_output_and_wait(self):