2.0_beta sync to rsa
[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                         /* size */
36                         width = 256;
37                         height = 512;
38                         widget.multimediaview( "size", width, height );
39                         equal( "width : " + widget.width() + ", height : " + widget.height(),
40                                 "width : " + width + ", height : " + height, "API: size" );
41
42                         /* fullscreen */
43                         fullscreenButton = widget.parent().find( ".ui-fullscreenbutton" );
44
45                         widget.multimediaview( "fullscreen", true );
46                         ok( fullscreenButton.hasClass( "ui-fullscreen-off" ), "API: fullscreen (on)" );
47
48                         widget.multimediaview("fullscreen", false );
49                         ok( fullscreenButton.hasClass( "ui-fullscreen-on" ), "API: fullscreen (off)" );
50                 }
51         };
52
53         test( "video", function () {
54                 unit_multimediaview( $("#video"), "video" );
55         });
56
57         test( "audio", function () {
58                 unit_multimediaview( $("#audio"), "audio" );
59         });
60
61 }( jQuery ));