VLCiOSTestVideoCodecs.swift 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*****************************************************************************
  2. * VLCiOSTestVideoCodecs.swift
  3. * VLC for iOSUITests
  4. *****************************************************************************
  5. * Copyright (c) 2018 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Mike JS. Choi <mkchoi212 # icloud.com>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. import Foundation
  13. import XCTest
  14. class VLCiOSTestVideoCodecs: XCTestCase {
  15. let app = XCUIApplication()
  16. var helper: TestHelper!
  17. override func setUp() {
  18. super.setUp()
  19. XCUIDevice.shared.orientation = .portrait
  20. setupSnapshot(app)
  21. helper = TestHelper(app)
  22. setupSnapshot(app)
  23. app.launch()
  24. }
  25. func testMovCodec() {
  26. stream(named: "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov")
  27. }
  28. func testHEVCCodec10b() {
  29. stream(named: "http://jell.yfish.us/media/jellyfish-90-mbps-hd-hevc-10bit.mkv")
  30. }
  31. func testHEVCCodec() {
  32. stream(named: "http://jell.yfish.us/media/jellyfish-25-mbps-hd-hevc.mkv")
  33. }
  34. func testH264Codec() {
  35. stream(named: "http://jell.yfish.us/media/jellyfish-25-mbps-hd-h264.mkv")
  36. }
  37. func stream(named fileName: String) {
  38. helper.tap(.Stream)
  39. let addressTextField = app.textFields["http://myserver.com/file.mkv"]
  40. addressTextField.clearAndEnter(text: fileName)
  41. app.buttons["Open Network Stream"].tap()
  42. let displayTime = app.navigationBars["VLCMovieView"].buttons["--:--"]
  43. let zeroPredicate = NSPredicate(format: "exists == 0")
  44. expectation(for: zeroPredicate, evaluatedWith: displayTime, handler: nil)
  45. waitForExpectations(timeout: 20.0) { err in
  46. XCTAssertNil(err)
  47. if !(self.app.buttons["Done"].exists) {
  48. self.app.otherElements["Video Player Title"].tap()
  49. }
  50. let playPause = self.app.buttons["Play Pause"]
  51. let onePredicate = NSPredicate(format: "exists == 1")
  52. self.expectation(for: onePredicate, evaluatedWith: playPause, handler: nil)
  53. self.waitForExpectations(timeout: 20.0, handler: nil)
  54. }
  55. }
  56. }