[Whale] Open cover when start buttons are released before cover closed.

When pushing starting buttons then releasing them fast, the cover should
open immediately.

BUG=chrome-os-partner:34544
TEST=test on Whale:
   1.press start buttons
   2.release start buttons fast
   3.expect cover opens immediately.

Change-Id: I526135b55d2d4e082d32222f57e707eaea3cef22
Reviewed-on: https://chromium-review.googlesource.com/236251
Reviewed-by: Dean Liao <deanliao@chromium.org>
Tested-by: Dean Liao <deanliao@chromium.org>
Commit-Queue: alastair jiang <alastair.jiang@quantacn.com>
Tested-by: alastair jiang <alastair.jiang@quantacn.com>
diff --git a/py/test/fixture/whale/host/interrupt_handler.py b/py/test/fixture/whale/host/interrupt_handler.py
index 9cd6c84..96ca988 100755
--- a/py/test/fixture/whale/host/interrupt_handler.py
+++ b/py/test/fixture/whale/host/interrupt_handler.py
@@ -105,7 +105,6 @@
     self._last_feedback = {}
 
     self._starting_fixture_action = None
-    self._starting_fixture_flag = False
 
     # Used to avoid toggle battery too fast.
     self._last_battery_toggle_time = time.time()
@@ -213,9 +212,6 @@
     """Start Fixture Step"""
     logging.info('[Fixture Start ...]')
 
-    if not self._starting_fixture_flag:
-      return
-
     if self._starting_fixture_action == ActionType.FIXTURE_STARTED:
       logging.info('[HandleStartFixture] ACTION = FIXTURE_STARTED')
       return
@@ -288,13 +284,12 @@
     status = self._servo.MultipleIsOn(self._BUTTON_LIST)
 
     if status[self._BUTTON.FIXTURE_STOP]:
-      self._starting_fixture_flag = False
       logging.info('Calling _HandleStopFixture because FIXTURE_STOP is True.')
       self._HandleStopFixture()
       return True
 
-    if self._starting_fixture_flag and not status[self._BUTTON.FIXTURE_START]:
-      self._starting_fixture_flag = False
+    if (self._starting_fixture_action != ActionType.FIXTURE_STARTED and
+        not status[self._BUTTON.FIXTURE_START]):
       logging.info('Calling _HandleStopFixture because FIXTURE_START is False.')
       self._HandleStopFixture()
       return False
@@ -317,9 +312,7 @@
       if button == self._BUTTON.FIXTURE_START:
         if self._starting_fixture_action == ActionType.FIXTURE_STARTED:
           logging.info('[START] ACTION = FIXTURE_STARTED')
-          self._starting_fixture_flag = False
         else:
-          self._starting_fixture_flag = True
           self._HandleStartFixture()
       elif button == self._BUTTON.RESERVE_1:
         self._ToggleBattery()