class TestActSmil

Public Instance Methods

test_media_plugin() click to toggle source
# File vendor/qwik/lib/qwik/act-smil.rb, line 194
    def test_media_plugin
      ok_wi([:div, {:class=>'box'},
              [:table, [:tr, [:td, 'IN'], [:td, 'OUT'], [:td, 'MSG']]],
              [:p, [:a, {:href=>'.attach/1.smil'}, '1']]],
            "{{video\n,k,v\n}}")

      t_add_user
      res = session('/test/.attach/1.smil') # get a file
      str = res.body
      ok_eq('application/smil', res['Content-Type'])

      # test real situation
      ok_wi([:div, {:class=>'box'},
              [:table,
                [:tr, [:td, 'IN'], [:td, 'OUT'], [:td, 'MSG']],
                [:tr, [:td, '00:03'], [:td, '00:13']],
                [:tr, [:td, '00:20'], [:td, '00:28']]],
              [:p, [:a, {:href=>'.attach/TestSmil.smil'}, 'TestSmil']]],
            '{{video(TestSmil)
:width:160
:height:120
:url:rtsp://stream.nhk.or.jp/news/20030914000046002.rm
,00:03,00:13,
,00:20,00:28,
}}')
      res = session('/test/.attach/TestSmil.smil')

      # test real situation
      ok_wi([:div, {:class=>'box'},
              [:table,
                [:tr, [:td, 'IN'], [:td, 'OUT'], [:td, 'MSG']],
                [:tr, [:td, '00:03'], [:td, '00:13'], [:td, 'あ']],
                [:tr, [:td, '00:20'], [:td, '00:28']]],
              [:p, [:a, {:href=>'.attach/TestSmil.smil'}, 'TestSmil']]],
            '{{video(TestSmil)
:width:160
:height:120
:url:rtsp://stream.nhk.or.jp/news/20030914000046002.rm
,00:03,00:13,あ
,00:20,00:28,
}}')
      res = session('/test/.attach/TestSmil.smil')
      str = res.body
      assert(str.include?('http://www.w3.org/2001/SMIL20/Language'))
    end
test_plg_video() click to toggle source
# File vendor/qwik/lib/qwik/act-smil.rb, line 165
    def test_plg_video
      t_add_user
      page = @site.create_new
      page.put('{{smil
:url:rtsp://example.com/test/1.files/t.rm
,00,05.05,msg1
,12:10,12:15.15,msg2
}}')
      res = session('/test/1.html')
      ok_in([:div, {:class=>'smil'},
              [:table,
                [:tr, [:th, 'IN'], [:th, 'OUT'], [:th, 'MSG']],
                [:tr, [:td, '00:00:00'], [:td, '00:00:05.05'],
                  [:td, 'msg1']],
                [:tr, [:td, '00:12:10'], [:td, '00:12:15.15'],
                  [:td, 'msg2']]],
              [:p, [:a, {:href=>'1.1.smil'}, '1.1.smil']]],
            '//div[@class="section"]')

      path = @site.files('1').path('1.1.smil')
      str = path.read
      assert(str.include?('http://www.w3.org/2001/SMIL20/Language'))

      res = session('/test/1.1.smil') # get the file
      str = res.body
      assert(str.include?('http://www.w3.org/2001/SMIL20/Language'))
      ok_eq('application/smil', res['Content-Type'])
    end