Best JavaScript code snippet using stryker-parent
oom_intervention.mojom.js
Source:oom_intervention.mojom.js
1// third_party/blink/public/mojom/oom_intervention/oom_intervention.mojom.js is auto generated by mojom_bindings_generator.py, do not edit2// Copyright 2014 The Chromium Authors. All rights reserved.3// Use of this source code is governed by a BSD-style license that can be4// found in the LICENSE file.5'use strict';6(function() {7 var mojomId = 'third_party/blink/public/mojom/oom_intervention/oom_intervention.mojom';8 if (mojo.internal.isMojomLoaded(mojomId)) {9 console.warn('The following mojom is loaded multiple times: ' + mojomId);10 return;11 }12 mojo.internal.markMojomLoaded(mojomId);13 var bindings = mojo;14 var associatedBindings = mojo;15 var codec = mojo.internal;16 var validator = mojo.internal;17 var exports = mojo.internal.exposeNamespace('blink.mojom');18 var shared_memory$ =19 mojo.internal.exposeNamespace('mojoBase.mojom');20 if (mojo.config.autoLoadMojomDeps) {21 mojo.internal.loadMojomIfNecessary(22 'mojo/public/mojom/base/shared_memory.mojom', '../../../../../mojo/public/mojom/base/shared_memory.mojom.js');23 }24 function DetectionArgs(values) {25 this.initDefaults_();26 this.initFields_(values);27 }28 DetectionArgs.prototype.initDefaults_ = function() {29 this.blinkWorkloadThreshold = 0;30 this.privateFootprintThreshold = 0;31 this.swapThreshold = 0;32 this.virtualMemoryThresold = 0;33 };34 DetectionArgs.prototype.initFields_ = function(fields) {35 for(var field in fields) {36 if (this.hasOwnProperty(field))37 this[field] = fields[field];38 }39 };40 DetectionArgs.validate = function(messageValidator, offset) {41 var err;42 err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);43 if (err !== validator.validationError.NONE)44 return err;45 var kVersionSizes = [46 {version: 0, numBytes: 40}47 ];48 err = messageValidator.validateStructVersion(offset, kVersionSizes);49 if (err !== validator.validationError.NONE)50 return err;51 return validator.validationError.NONE;52 };53 DetectionArgs.encodedSize = codec.kStructHeaderSize + 32;54 DetectionArgs.decode = function(decoder) {55 var packed;56 var val = new DetectionArgs();57 var numberOfBytes = decoder.readUint32();58 var version = decoder.readUint32();59 val.blinkWorkloadThreshold = decoder.decodeStruct(codec.Uint64);60 val.privateFootprintThreshold = decoder.decodeStruct(codec.Uint64);61 val.swapThreshold = decoder.decodeStruct(codec.Uint64);62 val.virtualMemoryThresold = decoder.decodeStruct(codec.Uint64);63 return val;64 };65 DetectionArgs.encode = function(encoder, val) {66 var packed;67 encoder.writeUint32(DetectionArgs.encodedSize);68 encoder.writeUint32(0);69 encoder.encodeStruct(codec.Uint64, val.blinkWorkloadThreshold);70 encoder.encodeStruct(codec.Uint64, val.privateFootprintThreshold);71 encoder.encodeStruct(codec.Uint64, val.swapThreshold);72 encoder.encodeStruct(codec.Uint64, val.virtualMemoryThresold);73 };74 function OomInterventionHost_OnHighMemoryUsage_Params(values) {75 this.initDefaults_();76 this.initFields_(values);77 }78 OomInterventionHost_OnHighMemoryUsage_Params.prototype.initDefaults_ = function() {79 };80 OomInterventionHost_OnHighMemoryUsage_Params.prototype.initFields_ = function(fields) {81 for(var field in fields) {82 if (this.hasOwnProperty(field))83 this[field] = fields[field];84 }85 };86 OomInterventionHost_OnHighMemoryUsage_Params.validate = function(messageValidator, offset) {87 var err;88 err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);89 if (err !== validator.validationError.NONE)90 return err;91 var kVersionSizes = [92 {version: 0, numBytes: 8}93 ];94 err = messageValidator.validateStructVersion(offset, kVersionSizes);95 if (err !== validator.validationError.NONE)96 return err;97 return validator.validationError.NONE;98 };99 OomInterventionHost_OnHighMemoryUsage_Params.encodedSize = codec.kStructHeaderSize + 0;100 OomInterventionHost_OnHighMemoryUsage_Params.decode = function(decoder) {101 var packed;102 var val = new OomInterventionHost_OnHighMemoryUsage_Params();103 var numberOfBytes = decoder.readUint32();104 var version = decoder.readUint32();105 return val;106 };107 OomInterventionHost_OnHighMemoryUsage_Params.encode = function(encoder, val) {108 var packed;109 encoder.writeUint32(OomInterventionHost_OnHighMemoryUsage_Params.encodedSize);110 encoder.writeUint32(0);111 };112 function OomIntervention_StartDetection_Params(values) {113 this.initDefaults_();114 this.initFields_(values);115 }116 OomIntervention_StartDetection_Params.prototype.initDefaults_ = function() {117 this.host = new OomInterventionHostPtr();118 this.detectionArgs = null;119 this.rendererPauseEnabled = false;120 this.navigateAdsEnabled = false;121 this.purgeV8MemoryEnabled = false;122 };123 OomIntervention_StartDetection_Params.prototype.initFields_ = function(fields) {124 for(var field in fields) {125 if (this.hasOwnProperty(field))126 this[field] = fields[field];127 }128 };129 OomIntervention_StartDetection_Params.validate = function(messageValidator, offset) {130 var err;131 err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);132 if (err !== validator.validationError.NONE)133 return err;134 var kVersionSizes = [135 {version: 0, numBytes: 32}136 ];137 err = messageValidator.validateStructVersion(offset, kVersionSizes);138 if (err !== validator.validationError.NONE)139 return err;140 // validate OomIntervention_StartDetection_Params.host141 err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 0, false);142 if (err !== validator.validationError.NONE)143 return err;144 // validate OomIntervention_StartDetection_Params.detectionArgs145 err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, DetectionArgs, false);146 if (err !== validator.validationError.NONE)147 return err;148 return validator.validationError.NONE;149 };150 OomIntervention_StartDetection_Params.encodedSize = codec.kStructHeaderSize + 24;151 OomIntervention_StartDetection_Params.decode = function(decoder) {152 var packed;153 var val = new OomIntervention_StartDetection_Params();154 var numberOfBytes = decoder.readUint32();155 var version = decoder.readUint32();156 val.host = decoder.decodeStruct(new codec.Interface(OomInterventionHostPtr));157 val.detectionArgs = decoder.decodeStructPointer(DetectionArgs);158 packed = decoder.readUint8();159 val.rendererPauseEnabled = (packed >> 0) & 1 ? true : false;160 val.navigateAdsEnabled = (packed >> 1) & 1 ? true : false;161 val.purgeV8MemoryEnabled = (packed >> 2) & 1 ? true : false;162 decoder.skip(1);163 decoder.skip(1);164 decoder.skip(1);165 decoder.skip(1);166 decoder.skip(1);167 decoder.skip(1);168 decoder.skip(1);169 return val;170 };171 OomIntervention_StartDetection_Params.encode = function(encoder, val) {172 var packed;173 encoder.writeUint32(OomIntervention_StartDetection_Params.encodedSize);174 encoder.writeUint32(0);175 encoder.encodeStruct(new codec.Interface(OomInterventionHostPtr), val.host);176 encoder.encodeStructPointer(DetectionArgs, val.detectionArgs);177 packed = 0;178 packed |= (val.rendererPauseEnabled & 1) << 0179 packed |= (val.navigateAdsEnabled & 1) << 1180 packed |= (val.purgeV8MemoryEnabled & 1) << 2181 encoder.writeUint8(packed);182 encoder.skip(1);183 encoder.skip(1);184 encoder.skip(1);185 encoder.skip(1);186 encoder.skip(1);187 encoder.skip(1);188 encoder.skip(1);189 };190 var kOomInterventionHost_OnHighMemoryUsage_Name = 0;191 function OomInterventionHostPtr(handleOrPtrInfo) {192 this.ptr = new bindings.InterfacePtrController(OomInterventionHost,193 handleOrPtrInfo);194 }195 function OomInterventionHostAssociatedPtr(associatedInterfacePtrInfo) {196 this.ptr = new associatedBindings.AssociatedInterfacePtrController(197 OomInterventionHost, associatedInterfacePtrInfo);198 }199 OomInterventionHostAssociatedPtr.prototype =200 Object.create(OomInterventionHostPtr.prototype);201 OomInterventionHostAssociatedPtr.prototype.constructor =202 OomInterventionHostAssociatedPtr;203 function OomInterventionHostProxy(receiver) {204 this.receiver_ = receiver;205 }206 OomInterventionHostPtr.prototype.onHighMemoryUsage = function() {207 return OomInterventionHostProxy.prototype.onHighMemoryUsage208 .apply(this.ptr.getProxy(), arguments);209 };210 OomInterventionHostProxy.prototype.onHighMemoryUsage = function() {211 var params_ = new OomInterventionHost_OnHighMemoryUsage_Params();212 var builder = new codec.MessageV0Builder(213 kOomInterventionHost_OnHighMemoryUsage_Name,214 codec.align(OomInterventionHost_OnHighMemoryUsage_Params.encodedSize));215 builder.encodeStruct(OomInterventionHost_OnHighMemoryUsage_Params, params_);216 var message = builder.finish();217 this.receiver_.accept(message);218 };219 function OomInterventionHostStub(delegate) {220 this.delegate_ = delegate;221 }222 OomInterventionHostStub.prototype.onHighMemoryUsage = function() {223 return this.delegate_ && this.delegate_.onHighMemoryUsage && this.delegate_.onHighMemoryUsage();224 }225 OomInterventionHostStub.prototype.accept = function(message) {226 var reader = new codec.MessageReader(message);227 switch (reader.messageName) {228 case kOomInterventionHost_OnHighMemoryUsage_Name:229 var params = reader.decodeStruct(OomInterventionHost_OnHighMemoryUsage_Params);230 this.onHighMemoryUsage();231 return true;232 default:233 return false;234 }235 };236 OomInterventionHostStub.prototype.acceptWithResponder =237 function(message, responder) {238 var reader = new codec.MessageReader(message);239 switch (reader.messageName) {240 default:241 return false;242 }243 };244 function validateOomInterventionHostRequest(messageValidator) {245 var message = messageValidator.message;246 var paramsClass = null;247 switch (message.getName()) {248 case kOomInterventionHost_OnHighMemoryUsage_Name:249 if (!message.expectsResponse() && !message.isResponse())250 paramsClass = OomInterventionHost_OnHighMemoryUsage_Params;251 break;252 }253 if (paramsClass === null)254 return validator.validationError.NONE;255 return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());256 }257 function validateOomInterventionHostResponse(messageValidator) {258 return validator.validationError.NONE;259 }260 var OomInterventionHost = {261 name: 'blink.mojom.OomInterventionHost',262 kVersion: 0,263 ptrClass: OomInterventionHostPtr,264 proxyClass: OomInterventionHostProxy,265 stubClass: OomInterventionHostStub,266 validateRequest: validateOomInterventionHostRequest,267 validateResponse: null,268 };269 OomInterventionHostStub.prototype.validator = validateOomInterventionHostRequest;270 OomInterventionHostProxy.prototype.validator = null;271 var kOomIntervention_StartDetection_Name = 0;272 function OomInterventionPtr(handleOrPtrInfo) {273 this.ptr = new bindings.InterfacePtrController(OomIntervention,274 handleOrPtrInfo);275 }276 function OomInterventionAssociatedPtr(associatedInterfacePtrInfo) {277 this.ptr = new associatedBindings.AssociatedInterfacePtrController(278 OomIntervention, associatedInterfacePtrInfo);279 }280 OomInterventionAssociatedPtr.prototype =281 Object.create(OomInterventionPtr.prototype);282 OomInterventionAssociatedPtr.prototype.constructor =283 OomInterventionAssociatedPtr;284 function OomInterventionProxy(receiver) {285 this.receiver_ = receiver;286 }287 OomInterventionPtr.prototype.startDetection = function() {288 return OomInterventionProxy.prototype.startDetection289 .apply(this.ptr.getProxy(), arguments);290 };291 OomInterventionProxy.prototype.startDetection = function(host, detectionArgs, rendererPauseEnabled, navigateAdsEnabled, purgeV8MemoryEnabled) {292 var params_ = new OomIntervention_StartDetection_Params();293 params_.host = host;294 params_.detectionArgs = detectionArgs;295 params_.rendererPauseEnabled = rendererPauseEnabled;296 params_.navigateAdsEnabled = navigateAdsEnabled;297 params_.purgeV8MemoryEnabled = purgeV8MemoryEnabled;298 var builder = new codec.MessageV0Builder(299 kOomIntervention_StartDetection_Name,300 codec.align(OomIntervention_StartDetection_Params.encodedSize));301 builder.encodeStruct(OomIntervention_StartDetection_Params, params_);302 var message = builder.finish();303 this.receiver_.accept(message);304 };305 function OomInterventionStub(delegate) {306 this.delegate_ = delegate;307 }308 OomInterventionStub.prototype.startDetection = function(host, detectionArgs, rendererPauseEnabled, navigateAdsEnabled, purgeV8MemoryEnabled) {309 return this.delegate_ && this.delegate_.startDetection && this.delegate_.startDetection(host, detectionArgs, rendererPauseEnabled, navigateAdsEnabled, purgeV8MemoryEnabled);310 }311 OomInterventionStub.prototype.accept = function(message) {312 var reader = new codec.MessageReader(message);313 switch (reader.messageName) {314 case kOomIntervention_StartDetection_Name:315 var params = reader.decodeStruct(OomIntervention_StartDetection_Params);316 this.startDetection(params.host, params.detectionArgs, params.rendererPauseEnabled, params.navigateAdsEnabled, params.purgeV8MemoryEnabled);317 return true;318 default:319 return false;320 }321 };322 OomInterventionStub.prototype.acceptWithResponder =323 function(message, responder) {324 var reader = new codec.MessageReader(message);325 switch (reader.messageName) {326 default:327 return false;328 }329 };330 function validateOomInterventionRequest(messageValidator) {331 var message = messageValidator.message;332 var paramsClass = null;333 switch (message.getName()) {334 case kOomIntervention_StartDetection_Name:335 if (!message.expectsResponse() && !message.isResponse())336 paramsClass = OomIntervention_StartDetection_Params;337 break;338 }339 if (paramsClass === null)340 return validator.validationError.NONE;341 return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());342 }343 function validateOomInterventionResponse(messageValidator) {344 return validator.validationError.NONE;345 }346 var OomIntervention = {347 name: 'blink.mojom.OomIntervention',348 kVersion: 0,349 ptrClass: OomInterventionPtr,350 proxyClass: OomInterventionProxy,351 stubClass: OomInterventionStub,352 validateRequest: validateOomInterventionRequest,353 validateResponse: null,354 };355 OomInterventionStub.prototype.validator = validateOomInterventionRequest;356 OomInterventionProxy.prototype.validator = null;357 exports.DetectionArgs = DetectionArgs;358 exports.OomInterventionHost = OomInterventionHost;359 exports.OomInterventionHostPtr = OomInterventionHostPtr;360 exports.OomInterventionHostAssociatedPtr = OomInterventionHostAssociatedPtr;361 exports.OomIntervention = OomIntervention;362 exports.OomInterventionPtr = OomInterventionPtr;363 exports.OomInterventionAssociatedPtr = OomInterventionAssociatedPtr;...
aframe-avatars.js
Source:aframe-avatars.js
1export function markup(2 /** @type {import("@notml/core").oom} */ oom,3 /** @type {import("@notml/core").OOMElementProxy} */ assets,4 /** @type {import("@notml/core").OOMElementProxy} */ scene5) {6 const userName = window.localStorage.getItem('username')7 const isArtist = userName.toLocaleLowerCase() === 'artist'8 const isPegasVr = userName.toLocaleLowerCase() === 'pegasvr'9 let pTemplate = 'player-template'10 if (isArtist) {11 pTemplate = 'artist-template'12 } else if (isPegasVr) {13 pTemplate = 'pegasvr-template'14 }15 assets(oom16 .aAssetItem({17 id: 'model-pegasvr',18 src: '/scene/models/SlavaAvatar.glb'19 })20 .aAssetItem({21 id: 'left-hand-model',22 src: '/scene/models/leftHandHigh.glb'23 })24 .aAssetItem({25 id: 'right-hand-model',26 src: '/scene/models/rightHandHigh.glb'27 })28 .template({ id: 'pegasvr-template' }, oom29 .aEntity({ class: 'avatar', networkedAudioSource: true }))30 .template({ id: 'pegasvr-template-head' }, oom31 .aEntity({ class: 'avatar-head' }, oom32 .aEntity({ class: 'nametag', text: 'value: name; align:center;', position: '0 0.8 0', rotation: '0 180 0', scale: '8 8 8' })33 .aEntity({34 gltfModel: '#model-pegasvr',35 position: '0 0 0',36 rotation: '0 180 0',37 scale: '0.45 0.5 0.4'38 })))39 .template({ id: 'artist-template' }, oom40 .aEntity({ class: 'avatar', networkedAudioSource: true }))41 .template({ id: 'artist-template-head' }, oom42 .aEntity({ class: 'avatar-head' }, oom43 .aEntity({ class: 'nametag', text: 'value: name; align:center;', position: '0 0.8 0', rotation: '0 180 0', scale: '8 8 8' })44 .aBox({ class: 'head', scale: '0.7 0.7 0.7' })45 .aEntity({ class: 'face', position: '0 0.05 0' }, oom46 .aSphere({ class: 'eye', color: '#efefef', position: '0.16 0.1 -0.35', scale: '0.12 0.12 0.12' }, oom47 .aSphere({ class: 'pupil', color: '#000', position: '0 0 -1', scale: '0.2 0.2 0.2' }))48 .aSphere({ class: 'eye', color: '#efefef', position: '-0.16 0.1 -0.35', scale: '0.12 0.12 0.12' }, oom49 .aSphere({ class: 'pupil', color: '#000', position: '0 0 -1', scale: '0.2 0.2 0.2' })))))50 .template({ id: 'player-template' }, oom51 .aEntity({ class: 'avatar', networkedAudioSource: true }))52 .template({ id: 'player-template-head' }, oom53 .aEntity({ class: 'avatar-head' }, oom54 .aEntity({ class: 'nametag', text: 'value: name; align:center;', position: '0 0.8 0', rotation: '0 180 0', scale: '8 8 8' })55 .aSphere({ class: 'head', scale: '0.45 0.5 0.4' })56 .aEntity({ class: 'face', position: '0 0.05 0' }, oom57 .aSphere({ class: 'eye', color: '#efefef', position: '0.16 0.1 -0.35', scale: '0.12 0.12 0.12' }, oom58 .aSphere({ class: 'pupil', color: '#000', position: '0 0 -1', scale: '0.2 0.2 0.2' }))59 .aSphere({ class: 'eye', color: '#efefef', position: '-0.16 0.1 -0.35', scale: '0.12 0.12 0.12' }, oom60 .aSphere({ class: 'pupil', color: '#000', position: '0 0 -1', scale: '0.2 0.2 0.2' })))))61 .template({ id: 'left-hand-template' }, oom62 .aEntity(oom.aGltfModel({ class: 'tracked-left-hand', rotation: '0 0 90', src: '#left-hand-model' })))63 .template({ id: 'right-hand-template' }, oom64 .aEntity(oom.aGltfModel({ class: 'tracked-right-hand', rotation: '0 0 -90', src: '#right-hand-model' })))65 )66 // @ts-ignore67 window.NAF.schemas.add({68 template: '#pegasvr-template',69 components: ['position', 'rotation']70 })71 // @ts-ignore72 window.NAF.schemas.add({73 template: '#left-hand-template',74 components: ['position', 'rotation']75 })76 // @ts-ignore77 window.NAF.schemas.add({78 template: '#right-hand-template',79 components: ['position', 'rotation']80 })81 // @ts-ignore82 window.NAF.schemas.add({83 template: '#pegasvr-template-head',84 components: ['position', 'rotation',85 {86 selector: '.head',87 component: 'material',88 property: 'color'89 },90 {91 selector: '.nametag',92 component: 'text',93 property: 'value'94 }95 ]96 })97 // @ts-ignore98 window.NAF.schemas.add({99 template: '#artist-template',100 components: ['position', 'rotation']101 })102 // @ts-ignore103 window.NAF.schemas.add({104 template: '#artist-template-head',105 components: ['position', 'rotation',106 {107 selector: '.nametag',108 component: 'text',109 property: 'value'110 },111 {112 selector: '.head',113 component: 'material',114 property: 'color'115 }116 ]117 })118 // @ts-ignore119 window.NAF.schemas.add({120 template: '#player-template',121 components: ['position', 'rotation']122 })123 // @ts-ignore124 window.NAF.schemas.add({125 template: '#player-template-head',126 components: ['position', 'rotation',127 {128 selector: '.nametag',129 component: 'text',130 property: 'value'131 },132 {133 selector: '.head',134 component: 'material',135 property: 'color'136 }137 ]138 })139 const player = oom140 .aEntity({141 id: 'player',142 movementControls: 'constrainToNavMesh: true; speed:0.2;',143 kinematicBody: 'enableJumps: true; mass: 5;',144 jumpAbility: 'maxJumps: 5; distance: 0.1;',145 navigator: 'cameraRig: #player; cameraHead: #head; collisionEntities: .collision; ignoreEntities: .clickable',146 networked: `template: #${pTemplate}; attachTemplateToLocal:false;`,147 position: '0 0 0',148 rotation: '0 0 0',149 spawnInCircle: 'radius:2'150 }, oom151 .aEntity({152 class: 'head',153 networked: `template: #${pTemplate}-head; attachTemplateToLocal:false;`,154 lookControls: 'pointerLockEnabled: true;',155 visible: 'false',156 camera: 'active: true',157 position: '0 1.6 0',158 rotation: '0 0 0'159 }, oom160 .aEntity({161 class: 'nametag',162 visible: 'false',163 text: `value: ${userName}; align:center;`164 })165 .aSphere({ class: 'head', randomColor: true }))166 .aEntity({167 class: 'leftController',168 networked: 'template: #left-hand-template',169 handControls: 'hand: left; handModelStyle: lowPoly; color: #15ACCF',170 trackedControls: true,171 viveControls: 'hand: left',172 oculusTouchControls: 'hand: left',173 windowsMotionControls: 'hand: left',174 teleportControls: 'cameraRig: #player; teleportOrigin: #head; button: trigger; type: line; curveShootingSpeed: 18; landingMaxAngle: 60',175 visible: 'true'176 })177 .aEntity({178 class: 'rightController',179 networked: 'template: #right-hand-template',180 handControls: 'hand: right; handModelStyle: lowPoly; color: #15ACCF',181 trackedControls: true,182 viveControls: 'hand: right',183 oculusTouchControls: 'hand: right',184 windowsMotionControls: 'hand: right',185 laserControls: true,186 raycaster: 'showLine: true; far: 10; interval: 0; objects: .clickable, a-link;',187 line: 'color: lawngreen; opacity: 0.5',188 visible: 'true'189 }))190 scene(player)...
scene.js
Source:scene.js
1export async function markup(/** @type {import("@notml/core").oom} */ oom) {2 const loadingLib = src => new Promise(resolve => {3 oom(window.document.head, oom.script({ src, onload: () => resolve() }))4 })5 const room = window.localStorage.getItem('room')6 const userName = window.localStorage.getItem('username')7 const isArtist = userName.toLocaleLowerCase() === 'artist'8 const isPegasVr = userName.toLocaleLowerCase() === 'pegasvr'9 const isSpeaker = isArtist || isPegasVr10 let hasMic = isSpeaker11 const style = document.createElement('style')12 style.innerHTML = `13 scene-actions { opacity: 0.7; position: fixed; bottom: 8px; left: 8px; }14 `15 oom(document.head, style)16 if (hasMic) {17 const media = await navigator.mediaDevices.getUserMedia({ audio: true }).catch(() => false)18 hasMic = !!media19 }20 // https://github.com/n5ro/aframe-extras/issues/36921 // await loadingLib('https://cdn.jsdelivr.net/npm/aframe@1.3.0/dist/aframe-master.js')22 await loadingLib('https://cdn.jsdelivr.net/npm/aframe@1.0.4/dist/aframe-master.js')23 await loadingLib('https://cdn.jsdelivr.net/npm/socket.io-client@4.4.1/dist/socket.io.js')24 // https://github.com/open-easyrtc/open-easyrtc/pull/7025 // 'https://cdn.jsdelivr.net/npm/open-easyrtc@2.0.13/api/easyrtc.js'26 await loadingLib('https://cdn.jsdelivr.net/gh/open-easyrtc/open-easyrtc@socket.io-4/api/easyrtc.js')27 await loadingLib('https://cdn.jsdelivr.net/npm/aframe-extras@6.1.1/dist/aframe-extras.js')28 await loadingLib('https://cdn.jsdelivr.net/npm/aframe-thumb-controls-component@2.0.2/dist/aframe-thumb-controls-component.js')29 await loadingLib('https://cdn.jsdelivr.net/npm/aframe-teleport-controls@0.3.1/dist/aframe-teleport-controls.js')30 // https://github.gitop.top/networked-aframe/networked-aframe/issues/28031 // await loadingLib('https://cdn.jsdelivr.net/npm/networked-aframe@0.9.1/dist/networked-aframe.js')32 await loadingLib('https://cdn.jsdelivr.net/npm/networked-aframe@0.8.3/dist/networked-aframe.js')33 await loadingLib('https://cdn.jsdelivr.net/gh/donmccurdy/aframe-physics-system@v3.2.0/dist/aframe-physics-system.js')34 await Promise.all([35 import('https://cdn.jsdelivr.net/npm/@material/mwc-fab@0.25.3/+esm')36 ])37 oom(window.document.head, oom38 .script({ src: './scene/aframe-register-component.js' }))39 const scripts = window.document.head.querySelectorAll('script')40 const script = scripts.item(scripts.length - 1)41 await new Promise(resolve => { script.onload = () => resolve() })42 const assets = oom.aAssets({ id: 'main-assets' })43 const scene = oom.aScene({44 id: 'main-scene',45 physics: 'gravity: -0.5;',46 networkedScene: `room: ${room}; debug: false; adapter: easyrtc; audio: ${hasMic};`47 }, assets)48 oom(window.document.body, scene)49 await import('./scene/aframe-world.js').then(({ markup }) => markup(oom, assets, scene))50 await import('./scene/aframe-avatars.js').then(({ markup }) => markup(oom, assets, scene))51 class SceneActions extends oom.extends(HTMLElement) {52 static tagName = 'scene-actions'53 // https://github.com/nodutilus/notml/issues/254 // static style = oom.style({55 // 'scene-actions': {56 // opacity: '0.7',57 // position: 'fixed',58 // bottom: '8px',59 // left: '8px'60 // }61 // })62 enableMicrophone = true63 micIcon = oom.mwcIcon({ slot: 'icon' }, hasMic ? 'mic' : 'mic_off')64 template = () => {65 const tmpl = oom()66 if (isSpeaker) {67 tmpl(oom68 .mwcFab({69 onclick: () => { if (hasMic) this.toggleMicrophone() },70 ...{ mini: true, label: 'Mic' }71 }, this.micIcon))72 }73 return tmpl74 }75 toggleMicrophone() {76 this.enableMicrophone = !this.enableMicrophone77 // @ts-ignore78 window.NAF.connection.adapter.enableMicrophone(this.enableMicrophone)79 this.micIcon({ innerHTML: this.enableMicrophone ? 'mic' : 'mic_off' })80 }81 }82 oom.define(SceneActions)83 oom(window.document.body, new SceneActions())...
Using AI Code Generation
1var oom = require('stryker-api').oom;2oom();3console.log('oom called');4process.on('exit', function () {5 console.log('process exited');6});7The test.js file is a simple file that imports the oom method from the required package and calls it. The process.on('exit',...) handler is added to check if the process has exited or not. The test.js file is executed using the following command:8console.log('process exiting with exit code 1');9process.exit(1);10console.log('this statement will not be executed');
Using AI Code Generation
1const oom = require('stryker-parent').oom;2oom('test');3const { oom } = require('stryker-parent');4oom('test');5const { oom } = require('stryker-parent');6oom('test');7const { oom } = require('stryker-parent');8oom('test');9const { oom } = require('stryker-parent');10oom('test');11const { oom } = require('stryker-parent');12oom('test');13const { oom } = require('stryker-parent');14oom('test');15const { oom } = require('stryker-parent');16oom('test');17const { oom } = require('stryker-parent');18oom('test');19const { oom } = require('stryker-parent');20oom('test');21const { oom } = require('stryker-parent');22oom('test');23const { oom } = require('stryker-parent');24oom('test');25const { oom } = require('stryker-parent');26oom('test');27const { oom } = require('stryker-parent');28oom('test');29const { oom } = require('stry
Using AI Code Generation
1var stryker = require('stryker-parent');2stryker.oom();3module.exports = {4 oom: function() {5 var arr = [];6 while (true) {7 arr.push(new Array(10000000));8 }9 }10};11var stryker = require('stryker-parent');12stryker.oom();13var childProcess = require('child_process');14module.exports = {15 oom: function() {16 var arr = [];17 var child = childProcess.fork(__dirname + '/child.js', [], { detached: true });18 child.unref();19 child.on('exit', function() {20 process.exit();21 });22 }23};
Using AI Code Generation
1const oom = require('stryker-parent').oom;2oom();3const oom = require('stryker-parent').oom;4oom();5const oom = require('stryker-parent').oom;6oom();7const oom = require('stryker-parent').oom;8oom();9const oom = require('stryker-parent').oom;10oom();11const oom = require('stryker-parent').oom;12oom();13const oom = require('stryker-parent').oom;14oom();15const oom = require('stryker-parent').oom;16oom();17const oom = require('stryker-parent').oom;18oom();19const oom = require('stryker-parent').oom;20oom();21const oom = require('stryker-parent').oom;22oom();23const oom = require('stryker-parent').oom;24oom();25const oom = require('stryker-parent').oom;26oom();27const oom = require('stryker-parent').oom;28oom();29const oom = require('stryker-parent').oom;30oom();31const oom = require('stryker-parent').oom;32oom();33const oom = require('stryker-parent').oom;34oom();
Using AI Code Generation
1var oom = require('stryker-parent').oom;2oom();3var oom = require('stryker').oom;4oom();5var oom = require('stryker').oom;6oom();7var oom = require('stryker-parent').oom;8oom();9var oom = require('stryker').oom;10oom();11var oom = require('stryker-parent').oom;12oom();13var oom = require('stryker').oom;14oom();15var oom = require('stryker-parent').oom;16oom();17var oom = require('stryker').oom;18oom();19var oom = require('stryker-parent').oom;20oom();21var oom = require('stryker').oom;22oom();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!