Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[webapi] Add deviceorientation tests
Browse files Browse the repository at this point in the history
Impacted tests(approved): new 6, update 0, delete 0
Unit test platform: Crosswalk Project for Android 20.50.531.0
Unit test result summary: pass 6, fail 0, block 0

BUG=https://crosswalk-project.org/jira/browse/CTS-1742
  • Loading branch information
yunxliu committed May 27, 2016
1 parent 28bde6a commit c513cd9
Show file tree
Hide file tree
Showing 8 changed files with 413 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<!--
Copyright (c) 2016 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.
-->

<meta charset="utf-8">
<title>Orientation Test: Rotate the device to provide an absolute orientation</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<p>Rotate the device to run the test.</p>
<div id="log"></div>
<script>
run = false;

async_test(function(t) {
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
if(!run) {
run = true;
assert_true(e.absolute);
t.done();
}
}), false);
}, document.title);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<!--
Copyright (c) 2016 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.
-->

<meta charset="utf-8">
<title>Orientation Test: Rotate the device frame around its x axis</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<p>Rotate the device frame around its x axis.</p>
<div id="log"></div>
<script>
var alpha = 0;
var run = false;

async_test(function(t) {
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
if(!run) {
run = true;
assert_greater_than(e.beta, -180);
assert_less_than(e.beta, 180);
t.done();
}
}), false);
}, document.title);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<!--
Copyright (c) 2016 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.
-->

<meta charset="utf-8">
<title>Orientation Test: Rotate the device frame around its y axis</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<p>Rotate the device frame around its y axis.</p>
<div id="log"></div>
<script>
var alpha = 0;
var run = false;

async_test(function(t) {
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
if(!run) {
run = true;
assert_greater_than(e.gamma, -90);
assert_less_than(e.gamma, 90);
t.done();
}
}), false);
}, document.title);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<!--
Copyright (c) 2016 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.
-->

<meta charset="utf-8">
<title>Orientation Test: Rotate the device frame around its z axis</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<p>Rotate the device frame around its z axis.</p>
<div id="log"></div>
<script>
var alpha = 0;
var run = false;

async_test(function(t) {
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
if(!run) {
run = true;
assert_greater_than(e.alpha, 0);
assert_less_than(e.alpha, 360);
t.done();
}
}), false);
}, document.title);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<!--
Copyright (c) 2016 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.
-->

<meta charset="utf-8">
<title>Orientation Test: deviceorientationabsolute attributes</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="log"></div>
<script>

async_test(function(t) {
window.addEventListener("deviceorientationabsolute", function(e) {
t.step(function() {
assert_true("alpha" in e);
assert_true("beta" in e);
assert_true("gamma" in e);
assert_true("absolute" in e);
assert_equals(typeof e.absolute, "boolean");
assert_true(e.absolute, "e.absolute is true");
});
t.done();
}, false);
}, document.title);

</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<!--
Copyright (c) 2016 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.
-->

<meta charset="utf-8">
<title>Orientation Test: Check The type of this event handler must be 'deviceorientationabsolute'</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(t) {
window.addEventListener("deviceorientationabsolute", function(e) {
t.step(function() {
assert_equals(e.type, "deviceorientationabsolute");
});
t.done();
}, false);
}, document.title);
</script>

72 changes: 72 additions & 0 deletions webapi/tct-deviceorientation-w3c-tests/tests.full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,78 @@
</spec>
</specs>
</testcase>
<testcase component="W3C_HTML5 APIs/Device/DeviceOrientation Event Specification" execution_type="auto" id="deviceorientationabsolute_event" priority="P1" purpose="Test deviceorientationabsolute event" status="approved" type="compliance">
<description>
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_event.html</test_script_entry>
</description>
<specs>
<spec>
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
<spec_statement/>
</spec>
</specs>
</testcase>
<testcase component="W3C_HTML5 APIs/Device/DeviceOrientation Event Specification" execution_type="manual" id="deviceorientationabsolute_event_type" priority="P1" purpose="Check that The corresponding event must be of type DeviceOrientationEvent and must fire on the window object" status="approved" type="compliance">
<description>
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_event_type-manual.html</test_script_entry>
</description>
<specs>
<spec>
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
<spec_statement/>
</spec>
</specs>
</testcase>
<testcase component="W3C_HTML5 APIs/Device/DeviceOrientation Event Specification" execution_type="manual" id="deviceorientationabsolute_deviceframe_z" priority="P1" purpose="Check that Rotate the device frame around its z axis" status="approved" type="compliance">
<description>
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_z-manual.html</test_script_entry>
</description>
<specs>
<spec>
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
<spec_statement/>
</spec>
</specs>
</testcase>
<testcase component="W3C_HTML5 APIs/Device/DeviceOrientation Event Specification" execution_type="manual" id="deviceorientationabsolute_deviceframe_x" priority="P1" purpose="Check that Rotate the device frame around its x axis" status="approved" type="compliance">
<description>
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_x-manual.html</test_script_entry>
</description>
<specs>
<spec>
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
<spec_statement/>
</spec>
</specs>
</testcase>
<testcase component="W3C_HTML5 APIs/Device/DeviceOrientation Event Specification" execution_type="manual" id="deviceorientationabsolute_deviceframe_y" priority="P1" purpose="Check that Rotate the device frame around its y axis" status="approved" type="compliance">
<description>
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_y-manual.html</test_script_entry>
</description>
<specs>
<spec>
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
<spec_statement/>
</spec>
</specs>
</testcase>
<testcase component="W3C_HTML5 APIs/Device/DeviceOrientation Event Specification" execution_type="manual" id="deviceorientationabsolute_absolute" priority="P1" purpose="Check that Rotate the device to provide an absolute orientation" status="approved" type="compliance">
<description>
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_absolute-manual.html</test_script_entry>
</description>
<specs>
<spec>
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
<spec_statement/>
</spec>
</specs>
</testcase>
</set>
</suite>
</test_definition>
Loading

0 comments on commit c513cd9

Please sign in to comment.