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

Commit 6ddb12d

Browse files
committed
[webapi] Add deviceorientation tests
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
1 parent 28bde6a commit 6ddb12d

8 files changed

+413
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright (c) 2016 Intel Corporation.
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
* Redistributions of works must retain the original copyright notice, this list
9+
of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the original copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this work without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
29+
<meta charset="utf-8">
30+
<title>Orientation Test: Rotate the device to provide an absolute orientation</title>
31+
<link rel="author" title="Intel" href="http://www.intel.com">
32+
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
33+
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
34+
<script src="../resources/testharness.js"></script>
35+
<script src="../resources/testharnessreport.js"></script>
36+
<p>Rotate the device to run the test.</p>
37+
<div id="log"></div>
38+
<script>
39+
run = false;
40+
41+
async_test(function(t) {
42+
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
43+
if(!run) {
44+
run = true;
45+
assert_true(e.absolute);
46+
t.done();
47+
}
48+
}), false);
49+
}, document.title);
50+
</script>
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright (c) 2016 Intel Corporation.
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
* Redistributions of works must retain the original copyright notice, this list
9+
of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the original copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this work without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
29+
<meta charset="utf-8">
30+
<title>Orientation Test: Rotate the device frame around its x axis</title>
31+
<link rel="author" title="Intel" href="http://www.intel.com">
32+
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
33+
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
34+
<script src="../resources/testharness.js"></script>
35+
<script src="../resources/testharnessreport.js"></script>
36+
<p>Rotate the device frame around its x axis.</p>
37+
<div id="log"></div>
38+
<script>
39+
var alpha = 0;
40+
var run = false;
41+
42+
async_test(function(t) {
43+
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
44+
if(!run) {
45+
run = true;
46+
assert_greater_than(e.beta, -180);
47+
assert_less_than(e.beta, 180);
48+
t.done();
49+
}
50+
}), false);
51+
}, document.title);
52+
</script>
53+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright (c) 2016 Intel Corporation.
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
* Redistributions of works must retain the original copyright notice, this list
9+
of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the original copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this work without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
29+
<meta charset="utf-8">
30+
<title>Orientation Test: Rotate the device frame around its y axis</title>
31+
<link rel="author" title="Intel" href="http://www.intel.com">
32+
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
33+
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
34+
<script src="../resources/testharness.js"></script>
35+
<script src="../resources/testharnessreport.js"></script>
36+
<p>Rotate the device frame around its y axis.</p>
37+
<div id="log"></div>
38+
<script>
39+
var alpha = 0;
40+
var run = false;
41+
42+
async_test(function(t) {
43+
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
44+
if(!run) {
45+
run = true;
46+
assert_greater_than(e.gamma, -90);
47+
assert_less_than(e.gamma, 90);
48+
t.done();
49+
}
50+
}), false);
51+
}, document.title);
52+
</script>
53+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright (c) 2016 Intel Corporation.
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
* Redistributions of works must retain the original copyright notice, this list
9+
of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the original copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this work without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
29+
<meta charset="utf-8">
30+
<title>Orientation Test: Rotate the device frame around its z axis</title>
31+
<link rel="author" title="Intel" href="http://www.intel.com">
32+
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
33+
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
34+
<script src="../resources/testharness.js"></script>
35+
<script src="../resources/testharnessreport.js"></script>
36+
<p>Rotate the device frame around its z axis.</p>
37+
<div id="log"></div>
38+
<script>
39+
var alpha = 0;
40+
var run = false;
41+
42+
async_test(function(t) {
43+
window.addEventListener("deviceorientationabsolute", t.step_func(function(e) {
44+
if(!run) {
45+
run = true;
46+
assert_greater_than(e.alpha, 0);
47+
assert_less_than(e.alpha, 360);
48+
t.done();
49+
}
50+
}), false);
51+
}, document.title);
52+
</script>
53+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright (c) 2016 Intel Corporation.
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
* Redistributions of works must retain the original copyright notice, this list
9+
of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the original copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this work without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
29+
<meta charset="utf-8">
30+
<title>Orientation Test: deviceorientationabsolute attributes</title>
31+
<link rel="author" title="Intel" href="http://www.intel.com">
32+
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
33+
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
34+
<script src="../resources/testharness.js"></script>
35+
<script src="../resources/testharnessreport.js"></script>
36+
<div id="log"></div>
37+
<script>
38+
39+
async_test(function(t) {
40+
window.addEventListener("deviceorientationabsolute", function(e) {
41+
t.step(function() {
42+
assert_true("alpha" in e);
43+
assert_true("beta" in e);
44+
assert_true("gamma" in e);
45+
assert_true("absolute" in e);
46+
assert_equals(typeof e.absolute, "boolean");
47+
assert_true(e.absolute, "e.absolute is true");
48+
});
49+
t.done();
50+
}, false);
51+
}, document.title);
52+
53+
</script>
54+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright (c) 2016 Intel Corporation.
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
* Redistributions of works must retain the original copyright notice, this list
9+
of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the original copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
* Neither the name of Intel Corporation nor the names of its contributors
14+
may be used to endorse or promote products derived from this work without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
29+
<meta charset="utf-8">
30+
<title>Orientation Test: Check The type of this event handler must be 'deviceorientationabsolute'</title>
31+
<link rel="author" title="Intel" href="http://www.intel.com">
32+
<link rel="author" title="Yunx Liu" href="mailto:yunx.liu@intel.com">
33+
<link rel="help" href="http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute">
34+
<script src="../resources/testharness.js"></script>
35+
<script src="../resources/testharnessreport.js"></script>
36+
<div id="log"></div>
37+
<script>
38+
async_test(function(t) {
39+
window.addEventListener("deviceorientationabsolute", function(e) {
40+
t.step(function() {
41+
assert_equals(e.type, "deviceorientationabsolute");
42+
});
43+
t.done();
44+
}, false);
45+
}, document.title);
46+
</script>
47+

webapi/tct-deviceorientation-w3c-tests/tests.full.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,78 @@
102102
</spec>
103103
</specs>
104104
</testcase>
105+
<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">
106+
<description>
107+
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_event.html</test_script_entry>
108+
</description>
109+
<specs>
110+
<spec>
111+
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
112+
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
113+
<spec_statement/>
114+
</spec>
115+
</specs>
116+
</testcase>
117+
<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">
118+
<description>
119+
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_event_type-manual.html</test_script_entry>
120+
</description>
121+
<specs>
122+
<spec>
123+
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
124+
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
125+
<spec_statement/>
126+
</spec>
127+
</specs>
128+
</testcase>
129+
<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">
130+
<description>
131+
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_z-manual.html</test_script_entry>
132+
</description>
133+
<specs>
134+
<spec>
135+
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
136+
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
137+
<spec_statement/>
138+
</spec>
139+
</specs>
140+
</testcase>
141+
<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">
142+
<description>
143+
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_x-manual.html</test_script_entry>
144+
</description>
145+
<specs>
146+
<spec>
147+
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
148+
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
149+
<spec_statement/>
150+
</spec>
151+
</specs>
152+
</testcase>
153+
<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">
154+
<description>
155+
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_y-manual.html</test_script_entry>
156+
</description>
157+
<specs>
158+
<spec>
159+
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
160+
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
161+
<spec_statement/>
162+
</spec>
163+
</specs>
164+
</testcase>
165+
<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">
166+
<description>
167+
<test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_absolute-manual.html</test_script_entry>
168+
</description>
169+
<specs>
170+
<spec>
171+
<spec_assertion category="Tizen W3C API Specifications" element_name="absolute" element_type="attribute" interface="DeviceOrientationEvent" section="Device" specification="Device Orientation Event Specification"/>
172+
<spec_url>http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute</spec_url>
173+
<spec_statement/>
174+
</spec>
175+
</specs>
176+
</testcase>
105177
</set>
106178
</suite>
107179
</test_definition>

0 commit comments

Comments
 (0)