Tizen 2.1 base
[platform/framework/web/web-ui-fw.git] / tests / unit-tests / multimediaview / multimediaview-tests.js
1 /*
2  * Unit Test: MultiMediaView
3  *
4  * Wonseop Kim <wonseop.kim@samsung.com>
5  */
6
7 (function ($) {
8         module("MultiMediaView");
9
10         var unit_multimediaview = function ( widget, type ) {
11                 var control,
12                         fullscreenButton,
13                         width,
14                         height,
15                         played,
16                         timeupdated,
17                         ended,
18                         param;
19
20                 /* Create */
21                 widget.multimediaview();
22                 ok( widget.hasClass( "ui-multimediaview" ) , "Create" );
23
24                 if ( type === "video" ) {
25                         /* width */
26                         width = 100;
27                         widget.multimediaview( "width", width );
28                         equal( width, widget.width(), "API: width" );
29
30                         /* height */
31                         height = 200;
32                         widget.multimediaview( "height", height );
33                         equal( height, widget.height(), "API: height" );
34
35                         /* fullscreen */
36                         fullscreenButton = widget.parent().find( ".ui-fullscreenbutton" );
37
38                         widget.multimediaview( "fullScreen", true );
39                         ok( fullscreenButton.hasClass( "ui-fullscreen-off" ), "API: fullScreen (on)" );
40
41                         widget.multimediaview( "fullScreen", false );
42                         ok( fullscreenButton.hasClass( "ui-fullscreen-on" ), "API: fullScreen (off)" );
43                 }
44         };
45
46         test( "video", function () {
47                 unit_multimediaview( $( "#video" ), "video" );
48         });
49
50         test( "audio", function () {
51                 unit_multimediaview( $( "#audio" ), "audio" );
52         });
53
54 }( jQuery ));