summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2013-03-14 14:21:53 +0200
committerMarc Englund <marc@vaadin.com>2013-03-15 07:57:28 +0200
commitf7b9f9f9afe8b09571d05f1790c9fe0c68a363a9 (patch)
tree3c58e63b7df5657fe8075879286c3f9723465230 /uitest/src/com/vaadin
parent468438fc0ff41c299e2e015f569f96fbd5e09411 (diff)
downloadvaadin-framework-f7b9f9f9afe8b09571d05f1790c9fe0c68a363a9.tar.gz
vaadin-framework-f7b9f9f9afe8b09571d05f1790c9fe0c68a363a9.zip
Audio/Video fixes, for #11160 but it was much more broken. Also quite a few browser differences.
Ticket: 11160 Change-Id: I1ee228e593eab75d96c285bfa26af9939e058d47
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r--uitest/src/com/vaadin/tests/components/media/AudioTest.html66
-rw-r--r--uitest/src/com/vaadin/tests/components/media/AudioTest.java86
-rw-r--r--uitest/src/com/vaadin/tests/components/media/bip.mp3bin0 -> 13837 bytes
-rw-r--r--uitest/src/com/vaadin/tests/components/media/bip.oggbin0 -> 15137 bytes
-rw-r--r--uitest/src/com/vaadin/tests/components/media/toyphone_dialling.mp3bin0 -> 80083 bytes
-rw-r--r--uitest/src/com/vaadin/tests/components/media/toyphone_dialling.oggbin0 -> 77861 bytes
6 files changed, 152 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/media/AudioTest.html b/uitest/src/com/vaadin/tests/components/media/AudioTest.html
new file mode 100644
index 0000000000..8425cad38a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/media/AudioTest.html
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>AudioTest</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">AudioTest</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/AudioTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>shortAtEndUnmuted</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCheckBox[0]/domChild[0]</td>
+ <td>11,7</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VCheckBox[0]/domChild[0]</td>
+ <td>6,7</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>5000</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>longerAtEndMuted</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VCheckBox[0]/domChild[0]</td>
+ <td>69,9</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>controlsHidden</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/media/AudioTest.java b/uitest/src/com/vaadin/tests/components/media/AudioTest.java
new file mode 100644
index 0000000000..28d1a7716f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/media/AudioTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.tests.components.media;
+
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.Resource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Audio;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.CheckBox;
+
+public class AudioTest extends TestBase {
+
+ @Override
+ protected void setup() {
+
+ // Public domain sounds from pdsounds.org 27.2.2013
+
+ final Resource[] s1 = { new ClassResource(getClass(), "bip.mp3"),
+ new ClassResource(getClass(), "bip.ogg") };
+ final Resource[] s2 = {
+ new ClassResource(getClass(), "toyphone_dialling.mp3"),
+ new ClassResource(getClass(), "toyphone_dialling.ogg") };
+
+ final Audio audio = new Audio();
+
+ audio.setSources(s1);
+ audio.setShowControls(true);
+ audio.setHtmlContentAllowed(true);
+ audio.setAltText("Can't <b>play</b> media");
+ audio.setAutoplay(true);
+
+ addComponent(audio);
+
+ CheckBox checkBox = new CheckBox("Show controls",
+ new MethodProperty<Boolean>(audio, "showControls"));
+ addComponent(checkBox);
+ checkBox = new CheckBox("HtmlContentAllowed",
+ new MethodProperty<Boolean>(audio, "htmlContentAllowed"));
+ addComponent(checkBox);
+ checkBox = new CheckBox("muted", new MethodProperty<Boolean>(audio,
+ "muted"));
+ addComponent(checkBox);
+ checkBox = new CheckBox("autoplay", new MethodProperty<Boolean>(audio,
+ "autoplay"));
+ addComponent(checkBox);
+
+ Button b = new Button("Change", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ audio.setSources(s2);
+ }
+ });
+ addComponent(b);
+ getLayout().setHeight("400px");
+ getLayout().setExpandRatio(b, 1.0f);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Should autoplay, manipulating checkboxes should do appropriate thing, button changes file.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 11160;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/media/bip.mp3 b/uitest/src/com/vaadin/tests/components/media/bip.mp3
new file mode 100644
index 0000000000..2c7e790cf7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/media/bip.mp3
Binary files differ
diff --git a/uitest/src/com/vaadin/tests/components/media/bip.ogg b/uitest/src/com/vaadin/tests/components/media/bip.ogg
new file mode 100644
index 0000000000..4e5014d92f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/media/bip.ogg
Binary files differ
diff --git a/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.mp3 b/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.mp3
new file mode 100644
index 0000000000..1788026856
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.mp3
Binary files differ
diff --git a/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.ogg b/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.ogg
new file mode 100644
index 0000000000..a042da5795
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.ogg
Binary files differ