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

Unified Diff: third_party/WebKit/LayoutTests/sensor/gyroscope.html

Issue 2506903003: [sensors] Gyroscope sensor bindings implementation (Closed)
Patch Set: Comments + rebase Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/sensor/gyroscope.html
diff --git a/third_party/WebKit/LayoutTests/sensor/gyroscope.html b/third_party/WebKit/LayoutTests/sensor/gyroscope.html
new file mode 100644
index 0000000000000000000000000000000000000000..04e28a54fca83379e72e58ff027f5a4350770e4a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/sensor/gyroscope.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/mojo-helpers.js"></script>
+<script src="resources/sensor-helpers.js"></script>
+<script src="resources/generic-sensor-tests.js"></script>
+<script>
+
+'use strict';
+
+if (!window.testRunner)
+ debug('This test cannot be run without the TestRunner');
+
+const kDefaultReadingX = 1.12345;
+const kDefaultReadingY = 2.12345;
+const kDefaultReadingZ = 3.12345;
+
+function update_sensor_reading(buffer) {
+ buffer[1] = window.performance.now();
+ buffer[2] = kDefaultReadingX;
+ buffer[3] = kDefaultReadingY;
+ buffer[4] = kDefaultReadingZ;
+}
+
+function verify_sensor_reading(reading) {
+ return reading.x == kDefaultReadingX &&
+ reading.y == kDefaultReadingY &&
+ reading.z == kDefaultReadingZ;
+}
+
+runGenericSensorTests(Gyroscope, update_sensor_reading, verify_sensor_reading);
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698