Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / page / actions / play_unittest.py
index bd4cf06..7224647 100644 (file)
@@ -7,7 +7,6 @@ from telemetry.core import util
 from telemetry.page.actions import play
 from telemetry.unittest import tab_test_case
 
-
 AUDIO_1_PLAYING_CHECK = 'window.__hasEventCompleted("#audio_1", "playing");'
 VIDEO_1_PLAYING_CHECK = 'window.__hasEventCompleted("#video_1", "playing");'
 VIDEO_1_ENDED_CHECK = 'window.__hasEventCompleted("#video_1", "ended");'
@@ -19,11 +18,10 @@ class PlayActionTest(tab_test_case.TabTestCase):
     tab_test_case.TabTestCase.setUp(self)
     self.Navigate('video_test.html')
 
-  @decorators.Disabled('android')
+  @decorators.Disabled('android', 'linux')  # crbug.com/418577
   def testPlayWithNoSelector(self):
     """Tests that with no selector Play action plays first video element."""
-    data = {'wait_for_playing': True}
-    action = play.PlayAction(data)
+    action = play.PlayAction(playing_event_timeout_in_seconds=5)
     action.WillRunAction(self._tab)
     # Both videos not playing before running action.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
@@ -33,11 +31,11 @@ class PlayActionTest(tab_test_case.TabTestCase):
     self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
     self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
 
-  @decorators.Disabled('android')
+  @decorators.Disabled('android', 'linux')  # crbug.com/418577
   def testPlayWithVideoSelector(self):
     """Tests that Play action plays video element matching selector."""
-    data = {'selector': '#video_1', 'wait_for_playing': True}
-    action = play.PlayAction(data)
+    action = play.PlayAction(selector='#video_1',
+                             playing_event_timeout_in_seconds=5)
     action.WillRunAction(self._tab)
     # Both videos not playing before running action.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
@@ -47,11 +45,11 @@ class PlayActionTest(tab_test_case.TabTestCase):
     self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
     self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
 
-  @decorators.Disabled('android')
+  @decorators.Disabled('android', 'linux')  # crbug.com/418577
   def testPlayWithAllSelector(self):
     """Tests that Play action plays all video elements with selector='all'."""
-    data = {'selector': 'all', 'wait_for_playing': True}
-    action = play.PlayAction(data)
+    action = play.PlayAction(selector='all',
+                             playing_event_timeout_in_seconds=5)
     action.WillRunAction(self._tab)
     # Both videos not playing before running action.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
@@ -62,22 +60,21 @@ class PlayActionTest(tab_test_case.TabTestCase):
     self.assertTrue(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
 
   # http://crbug.com/273887
+  @decorators.Disabled('linux')  # crbug.com/418577
   def testPlayWaitForPlayTimeout(self):
     """Tests that wait_for_playing timeouts if video does not play."""
-    data = {'selector': '#video_1',
-            'wait_for_playing': True,
-            'wait_timeout': 1}
-    action = play.PlayAction(data)
+    action = play.PlayAction(selector='#video_1',
+                             playing_event_timeout_in_seconds=5)
     action.WillRunAction(self._tab)
     self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""')
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
     self.assertRaises(util.TimeoutException, action.RunAction, self._tab)
 
-  @decorators.Disabled('android')
+  @decorators.Disabled('android', 'linux')  # crbug.com/418577
   def testPlayWaitForEnded(self):
     """Tests that wait_for_ended waits for video to end."""
-    data = {'selector': '#video_1', 'wait_for_ended': True}
-    action = play.PlayAction(data)
+    action = play.PlayAction(selector='#video_1',
+                             ended_event_timeout_in_seconds=5)
     action.WillRunAction(self._tab)
     # Assert video not playing before running action.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
@@ -86,10 +83,11 @@ class PlayActionTest(tab_test_case.TabTestCase):
     # Assert video ended.
     self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
 
+  @decorators.Disabled('linux')  # crbug.com/418577
   def testPlayWithoutWaitForEnded(self):
     """Tests that wait_for_ended waits for video to end."""
-    data = {'selector': '#video_1', 'wait_for_ended': False}
-    action = play.PlayAction(data)
+    action = play.PlayAction(selector='#video_1',
+                             ended_event_timeout_in_seconds=0)
     action.WillRunAction(self._tab)
     # Assert video not playing before running action.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
@@ -98,10 +96,11 @@ class PlayActionTest(tab_test_case.TabTestCase):
     # Assert video did not end.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
 
+  @decorators.Disabled('linux')  # crbug.com/418577
   def testPlayWaitForEndedTimeout(self):
     """Tests that action raises exception if timeout is reached."""
-    data = {'selector': '#video_1', 'wait_for_ended': True, 'wait_timeout': 1}
-    action = play.PlayAction(data)
+    action = play.PlayAction(selector='#video_1',
+                             ended_event_timeout_in_seconds=0.1)
     action.WillRunAction(self._tab)
     # Assert video not playing before running action.
     self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))