summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Antoszek <k.antoszek@samsung.com>2013-04-10 12:04:04 +0200
committerYoumin Ha <youmin.ha@samsung.com>2013-04-16 13:38:21 +0900
commit6eeb19c9d7c1022d310a93c6fbc34305883ffed6 (patch)
tree45fd6b67b8036553068b17265c342b685430ade0
parent2b8e8ab0aa5094acb2281e5180e85ae37eb6488f (diff)
downloadweb-ui-fw-6eeb19c9d7c1022d310a93c6fbc34305883ffed6.tar.gz
web-ui-fw-6eeb19c9d7c1022d310a93c6fbc34305883ffed6.tar.bz2
web-ui-fw-6eeb19c9d7c1022d310a93c6fbc34305883ffed6.zip
ensurens: qunit tests
Change-Id: Ifd09b2d6d01059b66f719ffee11e3a1bd575a7e8
-rw-r--r--tests/unit-tests/ensurens/ensurens-tests.js34
-rw-r--r--tests/unit-tests/ensurens/index.html25
-rwxr-xr-xtests/unit-tests/tests.js1
3 files changed, 60 insertions, 0 deletions
diff --git a/tests/unit-tests/ensurens/ensurens-tests.js b/tests/unit-tests/ensurens/ensurens-tests.js
new file mode 100644
index 00000000..af003937
--- /dev/null
+++ b/tests/unit-tests/ensurens/ensurens-tests.js
@@ -0,0 +1,34 @@
+/*
+ * Unit Test: EnsureNS
+ *
+ * Krzysztof Antoszek <k.antoszek@samsung.com>
+ */
+
+
+$(document).ready(function () {
+ module("ensureNS");
+ test("ensureNS test", function () {
+ var obj = {
+ "prop1": true,
+ "prop2": 1
+ };
+
+ // # TEST 1
+ equal(!!(window.ensure && window.ensure.tests && window.ensure.tests.leaf1), false);
+
+ ensureNS('window.ensure.tests.leaf1');
+
+ // # TEST 2
+ equal(!!(window.ensure && window.ensure.tests && window.ensure.tests.leaf1), true);
+
+ window.ensure.tests.leaf1 = obj;
+
+ ensureNS('window.ensure.tests.leaf1.leaf2');
+
+ // # TEST 3
+ equal(typeof window.ensure.tests.leaf1.leaf2, "object");
+
+ // # TEST 4
+ deepEqual(window.ensure.tests.leaf1, obj);
+ });
+}); \ No newline at end of file
diff --git a/tests/unit-tests/ensurens/index.html b/tests/unit-tests/ensurens/index.html
new file mode 100644
index 00000000..4958c844
--- /dev/null
+++ b/tests/unit-tests/ensurens/index.html
@@ -0,0 +1,25 @@
+<!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">
+ </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="../../../demos/tizen-winsets/widgets/list/virtuallist-db-demo.js"></script>
+ <script src="ensurens-tests.js"></script>
+ <title>ensureNS</title>
+ </head>
+
+ <body>
+ <h1 id="qunit-header">Extendablelist</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>
+ </body>
+</html>
diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js
index e560f77b..af645898 100755
--- a/tests/unit-tests/tests.js
+++ b/tests/unit-tests/tests.js
@@ -1,6 +1,7 @@
var TESTS = {
"testPages":[
// Put your test here
+ "ensurens",
"button",
"core",
"check",