<test_script_entry test_script_expected_result="0"></test_script_entry>
</description>
</testcase>
- <testcase purpose="Location Network Test" type="functional_positive" status="approved" component="behavior" execution_type="manual" priority="P0" id="LocationNetwork">
- <description>
- <pre_condition />
- <post_condition />
- <steps>
- <step order="1">
- <step_desc>0</step_desc>
- <expected>0</expected>
- </step>
- </steps>
- <test_script_entry test_script_expected_result="0"></test_script_entry>
- </description>
- </testcase>
<testcase purpose="Location GPS Test" type="functional_positive" status="approved" component="behavior" execution_type="manual" priority="P0" id="LocationGPS">
<description>
<pre_condition />
<test_script_entry test_script_expected_result="0" />
</description>
</testcase>
- <testcase component="behavior" execution_type="manual" id="LocationNetwork" purpose="Location Network Test">
- <description>
- <pre_condition />
- <steps>
- <step order="1">
- <step_desc>0</step_desc>
- <expected>0</expected>
- </step>
- </steps>
- <test_script_entry test_script_expected_result="0" />
- </description>
- </testcase>
<testcase component="behavior" execution_type="manual" id="LocationGPS" purpose="Location GPS Test">
<description>
<pre_condition />
+++ /dev/null
-/*
-Copyright (c) 2013 Intel Corporation.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of works must retain the original copyright notice, this list
- of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Authors:
- Xin, liu <xinx.liu@intel.com>
-
-*/
-
-.position_font {
- color: #3399FF;
- font-size: 20px;
-}
-
-.attribute_show {
- margin: 2px;
- margin-left: 5px;
- margin-right: 5px;
- height: 30px;
- line-height:30px;
-}
-
-.online_show {
- margin: 1px;
- height: 40px;
- border: #666666 solid thin;
- background-color: green;
- color: white;
-}
-
-.offline_show {
- margin:1px;
- height: 40px;
- border: #666666 solid thin;
- background-color: red;
- color: white;
-}
-
-.p_desc {
- font-size: 12px;
- font-weight: normal;
- display: block;
- margin: -.5em 0 .6em;
-}
-
-#map_canvas {
- background-color: #CCC;
- height: 330px;
- line-height:330px;
- margin: 5px auto;
-}
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Intel Corporation.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of works must retain the original copyright notice, this list
- of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Authors:
- Xinx, liu <xinx.liu@intel.com>
-
--->
-<html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width">
- <link rel="stylesheet" type="text/css" href="../../css/jquery.mobile.css" />
- <link rel="stylesheet" type="text/css" href="../../css/main.css" />
- <link rel="stylesheet" type="text/css" href="css/style.css"/>
- <script src="../../js/thirdparty/jquery.js"></script>
- <script src="../../js/thirdparty/jquery.mobile.js"></script>
- <script src="../../js/tests.js"></script>
- <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
- <script src="js/main.js"></script>
- <style>
- .observate {
- border: #000 solid 1px;
- height: 442px;
- margin-bottom: 10px;
- }
- </style>
- </head>
- <body onload="initialize()">
- <div data-role="header">
- <h1 id="main_page_title"></h1>
- </div>
- <div data-role="content">
- <div id="observateEare" class="observate">
- <div id="onLine" class="online_show" class="hideButton"></div>
- <div id="offLine" class="offline_show" class="hideButton"></div>
- <div id="latitudeDiv" class="attribute_show">Latitude:</div>
- <div id="longitudeDiv" class="attribute_show">Longitude:</div>
- <div id="errormessage"></div>
- <div align="center" id="map_canvas"></div>
- </div>
- <p class="p_desc">* Make sure the networking is enabled, and the GPS is disabled.</p>
- </div>
- <div data-role="footer" data-position="fixed">
- </div>
- <div data-role="popup" id="popup_info">
- <font class="fontSize">
- <p>Test Purpose: </p>
- <p>Verifies the location information of latitude and longitude position can be fetched through network.</p>
- <p>Test Pre-configuration: </p>
- <p>Ensure device networking is enabled and GPS is disabled.</p>
- <p>Expected Result: </p>
- <p>Test passes if both the latitude and longitude return the correct position data.</p>
- </font>
- </div>
- </body>
-</html>
+++ /dev/null
-/*
-Copyright (c) 2013 Intel Corporation.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of works must retain the original copyright notice, this list
- of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Authors:
- Liu, Xin <xinx.liu@intel.com>
-
-*/
-
-function initialize() {
- $.mobile.showPageLoadingMsg();
- var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
- if(connection==undefined){
- jQuery("#offLine").html("The navigator.connection is not supported");
- $.mobile.hidePageLoadingMsg();
- $("#offLine").show();
- $("#onLine").hide();
- printPosition("n/a","n/a");
- jQuery("#map_canvas").html("No data");
- }
- jQuery("#onLine").html("The current bandwidth is "+connection.bandwidth+" MB/s.");
- jQuery("#offLine").html("The current bandwidth is "+connection.bandwidth+" MB/s. Please check the network connection.");
- //browser state
- if(navigator.onLine){
- $("#offLine").hide();
- $("#onLine").show();
- }else {
- $.mobile.hidePageLoadingMsg();
- $("#offLine").show();
- $("#onLine").hide();
- printPosition("n/a","n/a");
- jQuery("#map_canvas").html("No data");
- }
-
- window.ononline = function () {
- jQuery("#onLine").html("The current bandwidth is "+connection.bandwidth+" MB/s.");
- $("#offLine").hide();
- $("#onLine").show();
- };
-
- window.onoffline = function () {
- jQuery("#offLine").html("The current bandwidth is "+connection.bandwidth+" MB/s. Please check the network connection.");
- $("#offLine").show();
- $("#onLine").hide();
- };
-
- var location;
- var geoSupportFlag = new Boolean();
- //defalut location
- var nanjing = new google.maps.LatLng(32.060255,118.796877);
- var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
-
- var myOptions = {
- zoom: 12,
- center: newyork,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
-
- if(navigator.geolocation) {
- geoSupportFlag = true;
- navigator.geolocation.getCurrentPosition(function(position) {
- $.mobile.hidePageLoadingMsg();
- var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
- location = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
- map.setCenter(location);
- printPosition(position.coords.latitude, position.coords.longitude);
- }, function() {
- handleNoGeolocation(geoSupportFlag);
- });
- } else {
- $.mobile.hidePageLoadingMsg();
- geoSupportFlag = false;
- handleNoGeolocation(geoSupportFlag);
- }
-
- function handleNoGeolocation(errorFlag) {
- $.mobile.hidePageLoadingMsg();
- if (errorFlag == true) {
- jQuery("#errormessage").html("<font color='red'>Geolocation service failed.</font>");
- jQuery("#map_canvas").html("No data");
- } else {
- jQuery("#errormessage").html("<font color='red'>Not Support Geolocation.</font>");
- jQuery("#map_canvas").html("No data");
- }
- }
-}
-
-function printPosition(latitude, longitude) {
- jQuery("#latitudeDiv").html("Latitude: " + latitude);
- jQuery("#longitudeDiv").html("Longitude: " + longitude);
-}
-