@@ -60,14 +60,14 @@ describe('lib/browsers/browser-cri-client', function () {
6060 'chrome-remote-interface' : criImport ,
6161 } )
6262
63- getClient = ( { protocolManager, cyPromptManager , fullyManageTabs } = { } ) => {
63+ getClient = ( { protocolManager, fullyManageTabs } = { } ) => {
6464 criClientCreateStub = criClientCreateStub . withArgs ( { target : 'http://web/socket/url' , onAsynchronousError : onError , onReconnect : undefined , protocolManager, fullyManageTabs } ) . resolves ( {
6565 send,
6666 on,
6767 close,
6868 } )
6969
70- return browserCriClient . BrowserCriClient . create ( { hosts : [ '127.0.0.1' ] , port : PORT , browserName : 'Chrome' , onAsynchronousError : onError , protocolManager, cyPromptManager , fullyManageTabs, onServiceWorkerClientEvent } )
70+ return browserCriClient . BrowserCriClient . create ( { hosts : [ '127.0.0.1' ] , port : PORT , browserName : 'Chrome' , onAsynchronousError : onError , protocolManager, fullyManageTabs, onServiceWorkerClientEvent } )
7171 }
7272 } )
7373
@@ -455,9 +455,8 @@ describe('lib/browsers/browser-cri-client', function () {
455455 context ( '#attachToTargetUrl' , function ( ) {
456456 it ( 'creates a page client when the passed in url is found' , async function ( ) {
457457 const mockProtocolClient = { }
458- const mockCyPromptClient = { }
459458 const mockPageClient = {
460- clone : sinon . stub ( ) . onFirstCall ( ) . returns ( mockProtocolClient ) . onSecondCall ( ) . returns ( mockCyPromptClient ) ,
459+ clone : sinon . stub ( ) . onFirstCall ( ) . returns ( mockProtocolClient ) ,
461460 }
462461
463462 send . withArgs ( 'Target.getTargets' ) . resolves ( { targetInfos : [ { targetId : '1' , url : 'http://foo.com' } , { targetId : '2' , url : 'http://bar.com' } ] } )
@@ -469,50 +468,39 @@ describe('lib/browsers/browser-cri-client', function () {
469468
470469 expect ( client ) . to . be . equal ( mockPageClient )
471470 expect ( browserClient . currentlyAttachedProtocolTarget ) . to . be . equal ( mockProtocolClient )
472- expect ( browserClient . currentlyAttachedCyPromptTarget ) . to . be . equal ( mockCyPromptClient )
473471 } )
474472
475473 it ( 'creates a page client when the passed in url is found and notifies the protocol manager and fully managed tabs' , async function ( ) {
476474 const mockProtocolClient = { }
477- const mockCyPromptClient = { }
478475 const mockPageClient = {
479- clone : sinon . stub ( ) . onFirstCall ( ) . returns ( mockProtocolClient ) . onSecondCall ( ) . returns ( mockCyPromptClient ) ,
476+ clone : sinon . stub ( ) . onFirstCall ( ) . returns ( mockProtocolClient ) ,
480477 }
481478 const protocolManager : any = {
482479 connectToBrowser : sinon . stub ( ) . resolves ( ) ,
483480 }
484- const cyPromptManager : any = {
485- connectToBrowser : sinon . stub ( ) . resolves ( ) ,
486- }
487481
488482 send . withArgs ( 'Target.getTargets' ) . resolves ( { targetInfos : [ { targetId : '1' , url : 'http://foo.com' } , { targetId : '2' , url : 'http://bar.com' } ] } )
489483 send . withArgs ( 'Target.setDiscoverTargets' , { discover : true } )
490484 on . withArgs ( 'Target.targetDestroyed' , sinon . match . func )
491485 criClientCreateStub . withArgs ( { target : '1' , onAsynchronousError : onError , host : HOST , port : PORT , protocolManager, fullyManageTabs : true , browserClient : { on, send, close } } ) . resolves ( mockPageClient )
492486
493- const browserClient = await getClient ( { protocolManager, cyPromptManager , fullyManageTabs : true } )
487+ const browserClient = await getClient ( { protocolManager, fullyManageTabs : true } )
494488
495489 const client = await browserClient . attachToTargetUrl ( 'http://foo.com' )
496490
497491 expect ( client ) . to . be . equal ( mockPageClient )
498492 expect ( browserClient . currentlyAttachedProtocolTarget ) . to . be . equal ( mockProtocolClient )
499- expect ( browserClient . currentlyAttachedCyPromptTarget ) . to . be . equal ( mockCyPromptClient )
500493 expect ( protocolManager . connectToBrowser ) . to . be . calledWith ( browserClient . currentlyAttachedProtocolTarget )
501- expect ( cyPromptManager . connectToBrowser ) . to . be . calledWith ( browserClient . currentlyAttachedCyPromptTarget )
502494 } )
503495
504496 it ( 'creates a page client when the passed in url is found and notifies the protocol manager and fully managed tabs and attaching to target throws' , async function ( ) {
505497 const mockProtocolClient = { }
506- const mockCyPromptClient = { }
507498 const mockPageClient = {
508- clone : sinon . stub ( ) . onFirstCall ( ) . returns ( mockProtocolClient ) . onSecondCall ( ) . returns ( mockCyPromptClient ) ,
499+ clone : sinon . stub ( ) . onFirstCall ( ) . returns ( mockProtocolClient ) ,
509500 }
510501 const protocolManager : any = {
511502 connectToBrowser : sinon . stub ( ) . resolves ( ) ,
512503 }
513- const cyPromptManager : any = {
514- connectToBrowser : sinon . stub ( ) . resolves ( ) ,
515- }
516504
517505 send . withArgs ( 'Target.getTargets' ) . resolves ( { targetInfos : [ { targetId : '1' , url : 'http://foo.com' } , { targetId : '2' , url : 'http://bar.com' } ] } )
518506 send . withArgs ( 'Target.setDiscoverTargets' , { discover : true } )
@@ -522,15 +510,13 @@ describe('lib/browsers/browser-cri-client', function () {
522510
523511 criClientCreateStub . withArgs ( { target : '1' , onAsynchronousError : onError , host : HOST , port : PORT , protocolManager, fullyManageTabs : true , browserClient : { on, send, close } } ) . resolves ( mockPageClient )
524512
525- const browserClient = await getClient ( { protocolManager, cyPromptManager , fullyManageTabs : true } )
513+ const browserClient = await getClient ( { protocolManager, fullyManageTabs : true } )
526514
527515 const client = await browserClient . attachToTargetUrl ( 'http://foo.com' )
528516
529517 expect ( client ) . to . be . equal ( mockPageClient )
530518 expect ( browserClient . currentlyAttachedProtocolTarget ) . to . be . equal ( mockProtocolClient )
531- expect ( browserClient . currentlyAttachedCyPromptTarget ) . to . be . equal ( mockCyPromptClient )
532519 expect ( protocolManager . connectToBrowser ) . to . be . calledWith ( browserClient . currentlyAttachedProtocolTarget )
533- expect ( cyPromptManager . connectToBrowser ) . to . be . calledWith ( browserClient . currentlyAttachedCyPromptTarget )
534520
535521 // This would throw if the error was not caught
536522 await on . withArgs ( 'Target.attachedToTarget' ) . args [ 0 ] [ 1 ] ( { targetInfo : { type : 'worker' } } )
0 commit comments