[CM-3489] Added splashscreen tests to autotest or mobilespec - created splashscreen jasmine tests - created splashscreen html page to launch tests - added splashscreen tests to all page
Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/a0c2690b Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/a0c2690b Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/a0c2690b Branch: refs/heads/master Commit: a0c2690bd67e97b345b51fcb0ce1ef72ec400cda Parents: 950c42e Author: ldeluca <[email protected]> Authored: Thu May 23 16:24:16 2013 -0400 Committer: Fil Maj <[email protected]> Committed: Wed Jun 19 18:49:34 2013 -0700 ---------------------------------------------------------------------- autotest/index.html | 1 + autotest/pages/all.html | 1 + autotest/pages/splashscreen.html | 71 +++++++++++++++++++++++++++++++ autotest/tests/splashscreen.tests.js | 36 ++++++++++++++++ 4 files changed, 109 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/a0c2690b/autotest/index.html ---------------------------------------------------------------------- diff --git a/autotest/index.html b/autotest/index.html index 6ebccbd..15f3ed2 100644 --- a/autotest/index.html +++ b/autotest/index.html @@ -53,6 +53,7 @@ <a href="pages/platform.html" class="btn large" style="width:100%;">Run Platform Tests</a> <a href="pages/storage.html" class="btn large" style="width:100%;">Run Storage Tests</a> <a href="pages/bridge.html" class="btn large" style="width:100%;">Run Bridge Tests</a> + <a href="pages/splashscreen.html" class="btn large" style="width:100%;">Run Splashscreen Tests</a> <h2> </h2><div class="backBtn" onclick="backHome();">Back</div> </body> http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/a0c2690b/autotest/pages/all.html ---------------------------------------------------------------------- diff --git a/autotest/pages/all.html b/autotest/pages/all.html index ad2eddd..533baf7 100644 --- a/autotest/pages/all.html +++ b/autotest/pages/all.html @@ -61,6 +61,7 @@ <script type="text/javascript" src="../tests/notification.tests.js"></script> <script type="text/javascript" src="../tests/platform.tests.js"></script> <script type="text/javascript" src="../tests/storage.tests.js"></script> + <script type="text/javascript" src="../tests/splashscreen.tests.js"></script> <script type="text/javascript"> var root, temp_root, persistent_root; http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/a0c2690b/autotest/pages/splashscreen.html ---------------------------------------------------------------------- diff --git a/autotest/pages/splashscreen.html b/autotest/pages/splashscreen.html new file mode 100644 index 0000000..d830f9e --- /dev/null +++ b/autotest/pages/splashscreen.html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> + + +<html> + +<head> + <title>Cordova: Splashscreen API Specs</title> + + <meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=1.0;" /> + <!-- Load jasmine --> + <link href="../jasmine.css" rel="stylesheet"/> + <script type="text/javascript" src="../jasmine.js"></script> + <script type="text/javascript" src="../html/HtmlReporterHelpers.js"></script> + <script type="text/javascript" src="../html/HtmlReporter.js"></script> + <script type="text/javascript" src="../html/ReporterView.js"></script> + <script type="text/javascript" src="../html/SpecView.js"></script> + <script type="text/javascript" src="../html/SuiteView.js"></script> + <script type="text/javascript" src="../html/TrivialReporter.js"></script> + + <!-- Source --> + <script type="text/javascript" src="../../cordova-incl.js"></script> + + <!-- Load Test Runner --> + <script type="text/javascript" src="../test-runner.js"></script> + + <!-- Tests --> + <script type="text/javascript" src="../tests/splashscreen.tests.js"></script> + + <script type="text/javascript"> + document.addEventListener('deviceready', function () { + var jasmineEnv = jasmine.getEnv(); + jasmineEnv.updateInterval = 1000; + + var htmlReporter = new jasmine.HtmlReporter(); + + jasmineEnv.addReporter(htmlReporter); + + jasmineEnv.specFilter = function(spec) { + return htmlReporter.specFilter(spec); + }; + + jasmineEnv.execute(); + }, false); + </script> +</head> + +<body> + <a href="javascript:" class="backBtn" onclick="backHome();">Back</a> +</body> +</html> + http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/a0c2690b/autotest/tests/splashscreen.tests.js ---------------------------------------------------------------------- diff --git a/autotest/tests/splashscreen.tests.js b/autotest/tests/splashscreen.tests.js new file mode 100644 index 0000000..107a435 --- /dev/null +++ b/autotest/tests/splashscreen.tests.js @@ -0,0 +1,36 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +describe('Splashscreen (cordova)', function () { + it("splashscreen.spec.1 should exist", function() { + expect(navigator.splashscreen).toBeDefined(); + }); + + it("splashscreen.spec.2 exec method should exist", function() { + expect(navigator.splashscreen.show).toBeDefined(); + expect(typeof navigator.splashscreen.show).toBe('function'); + }); + + it("splashscreen.spec.2 exec method should exist", function() { + expect(navigator.splashscreen.hide).toBeDefined(); + expect(typeof navigator.splashscreen.hide).toBe('function'); + }); +});
