Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: content/test/data/device_orientation/device_inertial_sensor_diagnostics.html

Issue 292693004: [DeviceLight] Browser+java part (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/data/device_orientation/device_inertial_sensor_diagnostics.html
diff --git a/content/test/data/device_orientation/device_inertial_sensor_diagnostics.html b/content/test/data/device_orientation/device_inertial_sensor_diagnostics.html
deleted file mode 100644
index 796357d2bb269595861aed3f9d5650a257fddb94..0000000000000000000000000000000000000000
--- a/content/test/data/device_orientation/device_inertial_sensor_diagnostics.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Device Motion/Orientation diagnostic measurements</title>
- </head>
- <body>
- <table>
- <tr>
- <td colspan="2">
- <hr>
- </td>
- </tr>
- <tr>
- <td>Motion Supported</td>
- <td width="250px" id="motionSupported"></td>
- </tr>
- <tr>
- <td>motion acceleration (x, y, z)</td>
- <td id="motionAccel"></td>
- </tr>
- <tr>
- <td>motion acceleration incl. gravity (x, y, z)</td>
- <td id="motionAccelG"></td>
- </tr>
- <tr>
- <td>motion rotation rate (&alpha;, &beta;, &gamma;)</td>
- <td id="motionRotation"></td>
- </tr>
- <tr>
- <td>real-time motion frequency (Hz)</td>
- <td id="motionFreq"></td>
- </tr>
- <tr>
- <td>motion max frequency (Hz)</td>
- <td id="motionMaxFreq"></td>
- </tr>
- <tr>
- <td>motion stated interval</td>
- <td id="motionInterval"></td>
- </tr>
- <tr>
- <td colspan="2">
- <hr>
- </td>
- </tr>
- <tr>
- <td>Orientation Supported</td>
- <td id="orientationSupported"></td>
- </tr>
- <tr>
- <td>orientation values (&alpha;, &beta;, &gamma;)</td>
- <td id="orientationValues"></td>
- </tr>
- <tr>
- <td>orientation absolute</td>
- <td id="orientationAbsolute"></td>
- </tr>
- <tr>
- <td>orientation frequency (Hz)</td>
- <td id="orientationFreq"></td>
- </tr>
- <tr>
- <td>orientation max frequency (Hz)</td>
- <td id="orientationMaxFreq"></td>
- </tr>
- </table>
-
- <script type="text/javascript">
- var numberMotionEvents = 0;
- var numberOrientationEvents = 0;
- var motionMaxFreq = 0;
- var orientationMaxFreq = 0;
- var updateIntervalDelaySec = 2;
-
- function onMotion(event) {
- document.getElementById('motionAccel').innerHTML =
- roundToFixedArray([event.acceleration.x,
- event.acceleration.y,
- event.acceleration.z]);
-
- document.getElementById("motionAccelG").innerHTML =
- roundToFixedArray([event.accelerationIncludingGravity.x,
- event.accelerationIncludingGravity.y,
- event.accelerationIncludingGravity.z]);
-
- document.getElementById("motionRotation").innerHTML =
- roundToFixedArray([event.rotationRate.alpha,
- event.rotationRate.beta,
- event.rotationRate.gamma]);
-
- document.getElementById("motionInterval").innerHTML = event.interval;
- ++numberMotionEvents;
- }
-
- function roundToFixed(value) {
- return value==null ? value : value.toFixed(4);
- }
-
- function roundToFixedArray(values) {
- return '[' + values.map(function(value) {
- return roundToFixed(value);
- }).join(',') + ']';
- }
-
- function onOrientation(event) {
- document.getElementById("orientationValues").innerHTML =
- roundToFixedArray([event.alpha, event.beta, event.gamma]);
- document.getElementById("orientationAbsolute").innerHTML = event.absolute;
- ++numberOrientationEvents;
- }
-
- function updateMeasurements() {
- var motionFreq = numberMotionEvents/updateIntervalDelaySec;
- var orientationFreq = numberOrientationEvents/updateIntervalDelaySec;
- motionMaxFreq = Math.max(motionMaxFreq, motionFreq);
- orientationMaxFreq = Math.max(orientationMaxFreq, orientationFreq);
-
- document.getElementById("motionFreq").innerHTML = motionFreq;
- document.getElementById("motionMaxFreq").innerHTML = motionMaxFreq;
- document.getElementById("orientationFreq").innerHTML = orientationFreq;
- document.getElementById("orientationMaxFreq").innerHTML = orientationMaxFreq;
-
- numberMotionEvents = 0;
- numberOrientationEvents = 0;
- }
-
- var motionSupported="not supported";
- var orientationSupported="not supported";
-
- if (window.DeviceMotionEvent) {
- window.addEventListener('devicemotion', onMotion)
- motionSupported="supported";
- }
- document.getElementById("motionSupported").innerHTML = motionSupported;
-
- if (window.DeviceOrientationEvent) {
- window.addEventListener('deviceorientation', onOrientation);
- orientationSupported = "supported";
- }
- document.getElementById("orientationSupported").innerHTML = orientationSupported;
-
- setInterval(function(){updateMeasurements()}, updateIntervalDelaySec*1000);
-
- </script>
-
- </body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698