From f7b9f9f9afe8b09571d05f1790c9fe0c68a363a9 Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Thu, 14 Mar 2013 14:21:53 +0200 Subject: Audio/Video fixes, for #11160 but it was much more broken. Also quite a few browser differences. Ticket: 11160 Change-Id: I1ee228e593eab75d96c285bfa26af9939e058d47 --- .../vaadin/tests/components/media/AudioTest.html | 66 ++++++++++++++++ .../vaadin/tests/components/media/AudioTest.java | 86 +++++++++++++++++++++ .../src/com/vaadin/tests/components/media/bip.mp3 | Bin 0 -> 13837 bytes .../src/com/vaadin/tests/components/media/bip.ogg | Bin 0 -> 15137 bytes .../tests/components/media/toyphone_dialling.mp3 | Bin 0 -> 80083 bytes .../tests/components/media/toyphone_dialling.ogg | Bin 0 -> 77861 bytes 6 files changed, 152 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/media/AudioTest.html create mode 100644 uitest/src/com/vaadin/tests/components/media/AudioTest.java create mode 100644 uitest/src/com/vaadin/tests/components/media/bip.mp3 create mode 100644 uitest/src/com/vaadin/tests/components/media/bip.ogg create mode 100644 uitest/src/com/vaadin/tests/components/media/toyphone_dialling.mp3 create mode 100644 uitest/src/com/vaadin/tests/components/media/toyphone_dialling.ogg (limited to 'uitest') 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 @@ + + + + + + +AudioTest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AudioTest
open/run/AudioTest?restartApplication
pause3000
screenCaptureshortAtEndUnmuted
mouseClickvaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCheckBox[0]/domChild[0]11,7
mouseClickvaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VCheckBox[0]/domChild[0]6,7
clickvaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]
pause5000
screenCapturelongerAtEndMuted
mouseClickvaadin=runAudioTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VCheckBox[0]/domChild[0]69,9
screenCapturecontrolsHidden
+ + 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 play media"); + audio.setAutoplay(true); + + addComponent(audio); + + CheckBox checkBox = new CheckBox("Show controls", + new MethodProperty(audio, "showControls")); + addComponent(checkBox); + checkBox = new CheckBox("HtmlContentAllowed", + new MethodProperty(audio, "htmlContentAllowed")); + addComponent(checkBox); + checkBox = new CheckBox("muted", new MethodProperty(audio, + "muted")); + addComponent(checkBox); + checkBox = new CheckBox("autoplay", new MethodProperty(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 Binary files /dev/null and b/uitest/src/com/vaadin/tests/components/media/bip.mp3 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 Binary files /dev/null and b/uitest/src/com/vaadin/tests/components/media/bip.ogg 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 Binary files /dev/null and b/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.mp3 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 Binary files /dev/null and b/uitest/src/com/vaadin/tests/components/media/toyphone_dialling.ogg differ -- cgit v1.2.3