Sha256: abf91f46237d68cae737bb05469ed0d57b273d7fe173330dbbac47c7641ce46b

Contents?: true

Size: 955 Bytes

Versions: 5

Compression:

Stored size: 955 Bytes

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

require_relative './lib/wxframe_runner'

# test seems to deadlock for WXGTK
if Wx.has_feature?(:USE_MEDIACTRL)

require 'uri'

class MediaCtrlTests < WxRuby::Test::GUITests

  def setup
    super
    @media = Wx::MediaCtrl.new(frame_win)
  end

  def cleanup
    @media.destroy
    super
  end

  attr_reader :media

  def test_uri
    # just checking if Ruby URI is properly mapped
    # it doesn't seem the mediactrl returns a very consistent result whether the resource is not a media file
    # or if it is a non-existing file so only check whether it is a boolean return.
    uri = URI("file://#{File.join(__dir__, 'media/beep_lo.wav')}")
    assert_boolean(media.load(uri))
    uri = URI("file://#{File.join(__dir__, 'art/test_art/image/wxruby.png')}")
    assert_boolean(media.load(uri))
  end

end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wxruby3-0.9.7-x64-mingw-ucrt tests/test_media_ctrl.rb
wxruby3-0.9.5-x64-mingw-ucrt tests/test_media_ctrl.rb
wxruby3-0.9.4-x64-mingw-ucrt tests/test_media_ctrl.rb
wxruby3-0.9.3-x64-mingw-ucrt tests/test_media_ctrl.rb
wxruby3-0.9.2-x64-mingw-ucrt tests/test_media_ctrl.rb