-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add accelerometer screen tests in sensor-tester (#50)
* Add accelerometer screen tests in sensor-tester
- Loading branch information
Showing
15 changed files
with
210 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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,15 @@ | ||
<link rel="import" href="../bower_components/polymer/polymer-element.html"> | ||
<link rel="import" href="sensor-tests-page.html"> | ||
|
||
<dom-module id="accelerometer-screen-page"> | ||
<template> | ||
<sensor-tests-page tests="src/tests/accelerometer-screen.json" sensortype="Accelerometer" referenceframe="screen" frequency="60"></sensor-tests-page> | ||
</template> | ||
|
||
<script> | ||
class AccelerometerScreenPage extends Polymer.Element { | ||
static get is() { return 'accelerometer-screen-page'; } | ||
} | ||
window.customElements.define(AccelerometerScreenPage.is, AccelerometerScreenPage); | ||
</script> | ||
</dom-module> |
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
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
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
15 changes: 15 additions & 0 deletions
15
sensor-tester/src/linearaccelerationsensor-screen-page.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,15 @@ | ||
<link rel="import" href="../bower_components/polymer/polymer-element.html"> | ||
<link rel="import" href="sensor-tests-page.html"> | ||
|
||
<dom-module id="linearaccelerationsensor-screen-page"> | ||
<template> | ||
<sensor-tests-page tests="src/tests/linearaccelerationsensor-screen.json" sensortype="LinearAccelerationSensor" referenceframe="screen" frequency="60"></sensor-tests-page> | ||
</template> | ||
|
||
<script> | ||
class LinearAccelerationSensorScreenPage extends Polymer.Element { | ||
static get is() { return 'linearaccelerationsensor-screen-page'; } | ||
} | ||
window.customElements.define(LinearAccelerationSensorScreenPage.is, LinearAccelerationSensorScreenPage); | ||
</script> | ||
</dom-module> |
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
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
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
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
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,66 @@ | ||
[ | ||
{ | ||
"name": "Test web page +Z gravity", | ||
"description": "Test that sensor reports +9.8 m/s^2 along the Z axis when device is at rest on a leveled surface and web page is facing towards the sky.", | ||
"illustration": "src/tests/accel_+z_gravity.png", | ||
"duration": 3, | ||
"expected": { "x": 0, "y": 0, "z": 9.8 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page -Z gravity", | ||
"description": "Test that sensor reports -9.8 m/s^2 along the Z axis when device is at rest on a leveled surface and web page is facing towards the ground.", | ||
"illustration": "src/tests/accel_-z_gravity.png", | ||
"duration": 4, | ||
"expected": { "x": 0, "y": 0, "z": -9.8 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page +X gravity", | ||
"description": "Test that sensor reports 9.8 m/s^2 along the X axis when device is at rest on a leveled surface and right edge of the web page points towards the ground.", | ||
"illustration": "src/tests/accel_+x_gravity.png", | ||
"duration": 3, | ||
"expected": { "x": 9.8, "y": 0, "z": 0 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page -X gravity", | ||
"description": "Test that sensor reports -9.8 m/s^2 along the X axis when device is at rest on a leveled surface and left edge of the web page points towards the ground.", | ||
"illustration": "src/tests/accel_-x_gravity.png", | ||
"duration": 3, | ||
"expected": { "x": -9.8, "y": 0, "z": 0 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page +Y gravity", | ||
"description": "Test that sensor reports 9.8 m/s^2 along the Y axis when device is at rest on a leveled surface and top edge of the web page points towards the sky.", | ||
"illustration": "src/tests/accel_+y_gravity.png", | ||
"duration": 4, | ||
"expected": { "x": 0, "y": 9.8, "z": 0 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page -Y gravity", | ||
"description": "Test that sensor reports -9.8 m/s^2 along the Y axis when device is at rest on a leveled surface and top edge of the web page points towards the ground.", | ||
"illustration": "src/tests/accel_-y_gravity.png", | ||
"duration": 4, | ||
"expected": { "x": 0, "y": -9.8, "z": 0 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page +X acceleration", | ||
"description": "Test that sensor reports positive acceleration along the X axis when device is pushed from the web page left edge to the right.", | ||
"illustration": "src/tests/accel_+x_acceleration.gif", | ||
"duration": 5, | ||
"expected": { "x": 3.0 }, | ||
"epsilon": 1 | ||
}, | ||
{ | ||
"name": "Test web page -X acceleration", | ||
"description": "Test that sensor reports negative acceleration along the X axis when device is pushed from the web page right edge to the left.", | ||
"illustration": "src/tests/accel_-x_acceleration.gif", | ||
"duration": 5, | ||
"expected": { "x": -3.0 }, | ||
"epsilon": 1 | ||
} | ||
] |
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.