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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/magnetometer/idlharness.https.html

Issue 2588723002: Import wpt@e1e2bfbe1d34de9826a036a0e9d43ba20190c69c (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>Magnetometer Sensor IDL tests</title>
4 <link rel="author" title="Intel" href="http://www.intel.com">
5 <link rel="help" href="https://www.w3.org/TR/magnetometer/">
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
8 <script src="/resources/WebIDLParser.js"></script>
9 <script src="/resources/idlharness.js"></script>
10 <style>
11 pre {
12 display: none;
13 }
14 </style>
15 <div id="log"></div>
16
17 <pre id="idl">
18 interface Event {
19 };
20
21 interface EventTarget {
22 };
23
24 interface EventHandler {
25 };
26
27 interface Error {
28 };
29
30 dictionary EventInit {
31 };
32 </pre>
33
34 <pre id="generic-idl">
35 [SecureContext]
36 interface Sensor : EventTarget {
37 readonly attribute SensorState state;
38 readonly attribute SensorReading? reading;
39 void start();
40 void stop();
41 attribute EventHandler onchange;
42 attribute EventHandler onactivate;
43 attribute EventHandler onerror;
44 };
45
46 dictionary SensorOptions {
47 double? frequency;
48 };
49
50 enum SensorState {
51 "idle",
52 "activating",
53 "activated",
54 "errored"
55 };
56
57 [SecureContext]
58 interface SensorReading {
59 readonly attribute DOMHighResTimeStamp timeStamp;
60 };
61
62 [SecureContext, Constructor(DOMString type, SensorErrorEventInit errorEventInitD ict)]
63 interface SensorErrorEvent : Event {
64 readonly attribute Error error;
65 };
66
67 dictionary SensorErrorEventInit : EventInit {
68 required Error error;
69 };
70
71 </pre>
72
73 <pre id="magnetometer-idl">
74 [Constructor(optional SensorOptions sensorOptions)]
75 interface Magnetometer : Sensor {
76 readonly attribute MagnetometerReading? reading;
77 };
78
79 [Constructor(MagnetometerReadingInit magnetometerReadingInit)]
80 interface MagnetometerReading : SensorReading {
81 readonly attribute double x;
82 readonly attribute double y;
83 readonly attribute double z;
84 };
85
86 dictionary MagnetometerReadingInit {
87 double x = 0;
88 double y = 0;
89 double z = 0;
90 };
91 </pre>
92
93 <script>
94 (function() {
95 "use strict";
96 var idl_array = new IdlArray();
97 idl_array.add_untested_idls(document.getElementById('idl').textContent);
98 idl_array.add_untested_idls(document.getElementById('generic-idl').textContent );
99 idl_array.add_idls(document.getElementById('magnetometer-idl').textContent);
100
101 idl_array.add_objects({
102 Magnetometer: ['new Magnetometer();'],
103 MagnetometerReading: ['new MagnetometerReading({x: 0.5, y: 0.5, z: 0.5});']
104 });
105
106 idl_array.test();
107 })();
108 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698