| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 | 2 |
| 3 let mockVRService = loadMojoModules( | 3 let mockVRService = loadMojoModules( |
| 4 'mockVRService', | 4 'mockVRService', |
| 5 ['mojo/public/js/bindings', | 5 ['mojo/public/js/bindings', |
| 6 'device/vr/vr_service.mojom', | 6 'device/vr/vr_service.mojom', |
| 7 ]).then(mojo => { | 7 ]).then(mojo => { |
| 8 let [bindings, vr_service] = mojo.modules; | 8 let [bindings, vr_service] = mojo.modules; |
| 9 | 9 |
| 10 class MockVRDisplay { | 10 class MockVRDisplay { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (this.pose_) { | 69 if (this.pose_) { |
| 70 this.pose_.timestamp = this.timeDelta_; | 70 this.pose_.timestamp = this.timeDelta_; |
| 71 this.pose_.poseIndex++; | 71 this.pose_.poseIndex++; |
| 72 } | 72 } |
| 73 | 73 |
| 74 let retval = Promise.resolve({ | 74 let retval = Promise.resolve({ |
| 75 pose: this.pose_, | 75 pose: this.pose_, |
| 76 time: { | 76 time: { |
| 77 microseconds: this.timeDelta_, | 77 microseconds: this.timeDelta_, |
| 78 }, | 78 }, |
| 79 frameId: 0, |
| 80 error: vr_service.VRVSyncProvider.Status.SUCCESS, |
| 79 }); | 81 }); |
| 80 | 82 |
| 81 this.timeDelta_ += 1000.0 / 60.0; | 83 this.timeDelta_ += 1000.0 / 60.0; |
| 82 return retval; | 84 return retval; |
| 83 } | 85 } |
| 84 initPose() { | 86 initPose() { |
| 85 this.pose_ = { | 87 this.pose_ = { |
| 86 timestamp: 0, | 88 timestamp: 0, |
| 87 orientation: null, | 89 orientation: null, |
| 88 position: null, | 90 position: null, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return new MockVRService(mojo.frameInterfaces); | 148 return new MockVRService(mojo.frameInterfaces); |
| 147 }); | 149 }); |
| 148 | 150 |
| 149 function vr_test(func, vrDisplays, name, properties) { | 151 function vr_test(func, vrDisplays, name, properties) { |
| 150 mockVRService.then( (service) => { | 152 mockVRService.then( (service) => { |
| 151 service.setVRDisplays(vrDisplays); | 153 service.setVRDisplays(vrDisplays); |
| 152 let t = async_test(name, properties); | 154 let t = async_test(name, properties); |
| 153 func(t, service); | 155 func(t, service); |
| 154 }); | 156 }); |
| 155 } | 157 } |
| OLD | NEW |