Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

AudioDeclarativeTest.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.server.component.audio;
  17. import java.io.File;
  18. import org.junit.Test;
  19. import com.vaadin.server.ExternalResource;
  20. import com.vaadin.server.FileResource;
  21. import com.vaadin.tests.design.DeclarativeTestBase;
  22. import com.vaadin.ui.Audio;
  23. /**
  24. * Tests specs of declarative support for abstract media and its
  25. * implementations.
  26. *
  27. * @since 7.4
  28. * @author Vaadin Ltd
  29. */
  30. public class AudioDeclarativeTest extends DeclarativeTestBase<Audio> {
  31. @Test
  32. public void testEmptyAudio() {
  33. String design = "<vaadin-audio />";
  34. Audio audio = new Audio();
  35. testRead(design, audio);
  36. testWrite(design, audio);
  37. }
  38. @Test
  39. public void testAudioMultipleSources() {
  40. String design = "<vaadin-audio muted show-controls='false'>"
  41. + "some <b>text</b>" //
  42. + "<source href='http://foo.pl' />"
  43. + "<source href='https://bar.pl' />" //
  44. + "<source href='ohai' />" //
  45. + "</vaadin-audio>";
  46. Audio audio = new Audio();
  47. audio.setAltText("some <b>text</b>");
  48. audio.setAutoplay(false);
  49. audio.setMuted(true);
  50. audio.setShowControls(false);
  51. audio.setSources(new ExternalResource("http://foo.pl"),
  52. new ExternalResource("https://bar.pl"), new FileResource(
  53. new File("ohai")));
  54. testRead(design, audio);
  55. testWrite(design, audio);
  56. }
  57. }