CB-6960 removed compass tests
diff --git a/www/autotest/pages/compass.html b/www/autotest/pages/compass.html
deleted file mode 100644
index 80de16f..0000000
--- a/www/autotest/pages/compass.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!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: Compass 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/compass.tests.js"></script>
- <script type="text/javascript" charset="utf-8" src="./run-tests.js"></script>
-</head>
-
-<body>
- <a href="javascript:" class="backBtn">Back</a>
-</body>
-</html>
-
diff --git a/www/autotest/tests/compass.tests.js b/www/autotest/tests/compass.tests.js
deleted file mode 100644
index 332daea..0000000
--- a/www/autotest/tests/compass.tests.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * 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('Compass (navigator.compass)', function () {
- var hardwarefailure = false;
- beforeEach(function() {
- this.addMatchers({
- // check to see if the device has a compass, if it doesn't fail gracefully
- hasHardware: function() {
- var toreturn = true;
-
- try{
- this.actual;
- toreturn = true;
- } catch (error){
- if (error.code == CompassError.COMPASS_NOT_SUPPORTED){
- hardwarefailure = true;
- toreturn = false;
- }
- }
- this.message = function () {
- return "The device does not have compass support. The remaining compass tests will be ignored.";
- }
-
- return toreturn;
- }
- });
- });
-
- afterEach(function () {
- // We want to gracefully fail if there is a hardware failure
- if(this.results_.failedCount > 0 && hardwarefailure == true) {
- //there was a hardware failure, cancelling all tests
- jasmine.Queue.prototype.next_ = function () { this.onComplete();}
- }
- });
-
- it("compass.hardwarecheck is compass supported", function() {
- var f = function(){navigator.compass.getCurrentHeading(function onSuccess(){}, function onError(error) {})};
- expect(f).hasHardware();
- });
-
- it("compass.spec.1 should exist", function() {
- expect(navigator.compass).toBeDefined();
- });
-
- it("compass.spec.2 should contain a getCurrentHeading function", function() {
- expect(navigator.compass.getCurrentHeading).toBeDefined();
- expect(typeof navigator.compass.getCurrentHeading == 'function').toBe(true);
- });
-
- it("compass.spec.3 getCurrentHeading success callback should be called with a Heading object", function() {
- var win = jasmine.createSpy().andCallFake(function(a) {
- expect(a instanceof CompassHeading).toBe(true);
- expect(a.magneticHeading).toBeDefined();
- expect(typeof a.magneticHeading == 'number').toBe(true);
- expect(a.trueHeading).not.toBe(undefined);
- expect(typeof a.trueHeading == 'number' || a.trueHeading === null).toBe(true);
- expect(a.headingAccuracy).not.toBe(undefined);
- expect(typeof a.headingAccuracy == 'number' || a.headingAccuracy === null).toBe(true);
- expect(typeof a.timestamp == 'number').toBe(true);
- }),
- fail = jasmine.createSpy();
-
- runs(function () {
- navigator.compass.getCurrentHeading(win, fail);
- });
-
- waitsFor(function () { return win.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT);
-
- runs(function () {
- expect(fail).not.toHaveBeenCalled();
- expect(win).toHaveBeenCalled();
- });
- });
-
- it("compass.spec.4 should contain a watchHeading function", function() {
- expect(navigator.compass.watchHeading).toBeDefined();
- expect(typeof navigator.compass.watchHeading == 'function').toBe(true);
- });
-
- it("compass.spec.5 should contain a clearWatch function", function() {
- expect(navigator.compass.clearWatch).toBeDefined();
- expect(typeof navigator.compass.clearWatch == 'function').toBe(true);
- });
-
- describe('Compass Constants (window.CompassError)', function () {
- it("compass.spec.1 should exist", function() {
- expect(window.CompassError).toBeDefined();
- expect(window.CompassError.COMPASS_INTERNAL_ERR).toBe(0);
- expect(window.CompassError.COMPASS_NOT_SUPPORTED).toBe(20);
- });
- });
-
- describe('Compass Heading model (CompassHeading)', function () {
- it("compass.spec.1 should exist", function() {
- expect(CompassHeading).toBeDefined();
- });
-
- it("compass.spec.8 should be able to create a new CompassHeading instance with no parameters", function() {
- var h = new CompassHeading();
- expect(h).toBeDefined();
- expect(h.magneticHeading).toBeUndefined();
- expect(h.trueHeading).toBeUndefined();
- expect(h.headingAccuracy).toBeUndefined();
- expect(typeof h.timestamp == 'number').toBe(true);
- });
-
- it("compass.spec.9 should be able to create a new CompassHeading instance with parameters", function() {
- var h = new CompassHeading(1,2,3,4);
- expect(h.magneticHeading).toBe(1);
- expect(h.trueHeading).toBe(2);
- expect(h.headingAccuracy).toBe(3);
- expect(h.timestamp.valueOf()).toBe(4);
- expect(typeof h.timestamp == 'number').toBe(true);
- });
- });
-});
diff --git a/www/compass/index.html b/www/compass/index.html
deleted file mode 100644
index 1734caa..0000000
--- a/www/compass/index.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!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>
- <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
- <title>Cordova Mobile Spec</title>
- <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
- <script type="text/javascript" charset="utf-8" src="./index.js"></script>
- </head>
- <body id="stage" class="theme">
-
- <h1>Compass</h1>
- <div id="info">
- <b>Status:</b> <span id="compass_status">Stopped</span>
- <table width="100%"><tr>
- <td width="33%">Heading: <span id="compassHeading"> </span></td>
- </tr></table>
- </div>
- <h2>Action</h2>
- <div class="btn large getCompass">Get Compass</div>
- <div class="btn large watchCompass">Start Watching Compass</div>
- <div class="btn large stopCompass">Stop Watching Compass</div>
- <h2> </h2><div class="backBtn">Back</div>
- </body>
-</html>
diff --git a/www/compass/index.js b/www/compass/index.js
deleted file mode 100644
index 0735ab2..0000000
--- a/www/compass/index.js
+++ /dev/null
@@ -1,104 +0,0 @@
-var deviceReady = false;
-
-function roundNumber(num) {
- var dec = 3;
- var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
- return result;
-}
-
-//-------------------------------------------------------------------------
-// Compass
-//-------------------------------------------------------------------------
-var watchCompassId = null;
-
-/**
- * Start watching compass
- */
-var watchCompass = function() {
- console.log("watchCompass()");
-
- // Success callback
- var success = function(a){
- document.getElementById('compassHeading').innerHTML = roundNumber(a.magneticHeading);
- };
-
- // Fail callback
- var fail = function(e){
- console.log("watchCompass fail callback with error code "+e);
- stopCompass();
- setCompassStatus(e);
- };
-
- // Update heading every 1 sec
- var opt = {};
- opt.frequency = 1000;
- watchCompassId = navigator.compass.watchHeading(success, fail, opt);
-
- setCompassStatus("Running");
-};
-
-/**
- * Stop watching the acceleration
- */
-var stopCompass = function() {
- setCompassStatus("Stopped");
- if (watchCompassId) {
- navigator.compass.clearWatch(watchCompassId);
- watchCompassId = null;
- }
-};
-
-/**
- * Get current compass
- */
-var getCompass = function() {
- console.log("getCompass()");
-
- // Stop compass if running
- stopCompass();
-
- // Success callback
- var success = function(a){
- document.getElementById('compassHeading').innerHTML = roundNumber(a.magneticHeading);
- };
-
- // Fail callback
- var fail = function(e){
- console.log("getCompass fail callback with error code "+e);
- setCompassStatus(e);
- };
-
- // Make call
- var opt = {};
- navigator.compass.getCurrentHeading(success, fail, opt);
-};
-
-/**
- * Set compass status
- */
-var setCompassStatus = function(status) {
- document.getElementById('compass_status').innerHTML = status;
-};
-
-/**
- * Function called when page has finished loading.
- */
-function init() {
- document.addEventListener("deviceready", function() {
- deviceReady = true;
- console.log("Device="+device.platform+" "+device.version);
- }, false);
- window.setTimeout(function() {
- if (!deviceReady) {
- alert("Error: Apache Cordova did not initialize. Demo will not run correctly.");
- }
- },1000);
-}
-
-window.onload = function() {
- addListenerToClass('getCompass', getCompass);
- addListenerToClass('watchCompass', watchCompass);
- addListenerToClass('stopCompass', stopCompass);
- addListenerToClass('backBtn', backHome);
- init();
-}