This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
8 changed files
with
413 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...iceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_absolute-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
53 changes: 53 additions & 0 deletions
53
...ientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_x-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
53 changes: 53 additions & 0 deletions
53
...ientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_y-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
53 changes: 53 additions & 0 deletions
53
...ientation-w3c-tests/deviceorientation/deviceorientationabsolute_deviceframe_z-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
54 changes: 54 additions & 0 deletions
54
...pi/tct-deviceorientation-w3c-tests/deviceorientation/deviceorientationabsolute_event.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
47 changes: 47 additions & 0 deletions
47
...eorientation-w3c-tests/deviceorientation/deviceorientationabsolute_event_type-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.