Sha256: 6c35f4728b5731ac71958a7a4b88a2b36c522fcd1dc39f769c2f72cd824675d6

Contents?: true

Size: 917 Bytes

Versions: 18

Compression:

Stored size: 917 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

18 entries across 18 versions & 1 rubygems

Version Path
wxruby3-1.5.0 tests/test_media_ctrl.rb
wxruby3-1.4.2 tests/test_media_ctrl.rb
wxruby3-1.4.1 tests/test_media_ctrl.rb
wxruby3-1.4.0 tests/test_media_ctrl.rb
wxruby3-1.3.1 tests/test_media_ctrl.rb
wxruby3-1.3.0 tests/test_media_ctrl.rb
wxruby3-1.2.1 tests/test_media_ctrl.rb
wxruby3-1.2.0 tests/test_media_ctrl.rb
wxruby3-1.1.2 tests/test_media_ctrl.rb
wxruby3-1.1.1 tests/test_media_ctrl.rb
wxruby3-1.1.0 tests/test_media_ctrl.rb
wxruby3-1.0.1 tests/test_media_ctrl.rb
wxruby3-0.9.8 tests/test_media_ctrl.rb
wxruby3-0.9.7 tests/test_media_ctrl.rb
wxruby3-0.9.5 tests/test_media_ctrl.rb
wxruby3-0.9.4 tests/test_media_ctrl.rb
wxruby3-0.9.3 tests/test_media_ctrl.rb
wxruby3-0.9.2 tests/test_media_ctrl.rb