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

Side by Side Diff: third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js

Issue 2711173002: Prevent browser crash resulting from misbehaving WebVR renderer requesting multiple VSyncs. (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « device/vr/vr_service.mojom ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « device/vr/vr_service.mojom ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698