unit-test: split progress test and progressbar test
authorMinkyu Kang <mk7.kang@samsung.com>
Wed, 20 Feb 2013 02:03:27 +0000 (11:03 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Thu, 7 Mar 2013 12:04:16 +0000 (21:04 +0900)
Change-Id: I5c65241350fe2c3c3811a5a7d8248528aaa45111

tests/unit-tests/progress/index.html [new file with mode: 0755]
tests/unit-tests/progress/progress-tests.js [new file with mode: 0644]
tests/unit-tests/progressbar/index.html
tests/unit-tests/progressbar/progressbar-tests.js
tests/unit-tests/tests.js

diff --git a/tests/unit-tests/progress/index.html b/tests/unit-tests/progress/index.html
new file mode 100755 (executable)
index 0000000..0d05f86
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="progress-tests.js"></script>
+
+       <title>Progress</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Progressbar</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="progress_demo">
+               <div data-role="header" data-position="fixed">
+                       <h1>Progressbar</h1>
+               </div>
+               <div data-role="content">
+                       <ul data-role="listview">
+                               <li><div data-role="progressing" data-style="pending" id="pending"></div></li>
+                               <li><div data-role="progressing" data-style="circle" id="progressing"></div></li>
+                       </ul>
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/unit-tests/progress/progress-tests.js b/tests/unit-tests/progress/progress-tests.js
new file mode 100644 (file)
index 0000000..8ffe234
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Unit Test: Progress
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+
+(function ($) {
+       module("Progress");
+
+       var unit_progress = function ( widget, type ) {
+               var progress,
+                       elem = ".ui-progress-" + type,
+                       _class = "ui-progress-" + type + "-running";
+
+               widget.progress();
+
+               /* Create */
+               progress = widget.find( elem );
+               ok( progress, "Create" );
+
+               /* Option */
+               equal( widget.progress( "option", "style" ), type, "Option: style" );
+
+               /* Running */
+               widget.progress( "running", true );
+               progress = widget.find( elem );
+               equal( progress.hasClass( _class ), true, "API: running" );
+
+               /* Stop */
+               widget.progress( "running", false );
+               progress = widget.find( elem );
+               equal( progress.hasClass( _class ), false, "API: stop" );
+       };
+
+       test( "pending bar", function () {
+               unit_progress( $("#pending"), "pending" );
+       });
+
+       test( "processing circle", function () {
+               unit_progress( $("#progressing"), "circle" );
+       });
+}( jQuery ));
index 4bd0f3f..5dfe65b 100755 (executable)
@@ -33,8 +33,6 @@
                <div data-role="content">
                        <ul data-role="listview">
                                <li><div data-role="progressbar" id="progressbar"></div></li>
-                               <li><div data-role="progressing" data-style="pending" id="pending"></div></li>
-                               <li><div data-role="progressing" data-style="circle" id="progressing"></div></li>
                        </ul>
                </div>
        </div>
index c9f6832..1b75bc2 100644 (file)
                }
        };
 
-       var unit_progress = function ( widget, type ) {
-               var progress,
-                       elem = ".ui-progress-" + type,
-                       _class = "ui-progress-" + type + "-running";
-
-               widget.progress();
-
-               /* Create */
-               progress = widget.find( elem );
-               ok( progress, "Create" );
-
-               /* Option */
-               equal( widget.progress( "option", "style" ), type, "Option: style" );
-
-               /* Running */
-               widget.progress( "running", true );
-               progress = widget.find( elem );
-               equal( progress.hasClass( _class ), true, "API: running" );
-
-               /* Stop */
-               widget.progress( "running", false );
-               progress = widget.find( elem );
-               equal( progress.hasClass( _class ), false, "API: stop" );
-       };
-
        test( "progressbar", function () {
                unit_progressbar( $("#progressbar") );
        });
-
-       test( "pending bar", function () {
-               unit_progress( $("#pending"), "pending" );
-       });
-
-       test( "processing circle", function () {
-               unit_progress( $("#progressing"), "circle" );
-       });
 }( jQuery ));
index 14689e1..7963c9b 100755 (executable)
@@ -14,6 +14,7 @@ var TESTS = {
                "popupwindow",
                "popupwindow_ctxpopup",
                "progressbar",
+               "progress",
                "radio",
                "searchbar",
                "segmentcontrol",