@@ -4108,7 +4108,8 @@ test('done_json validates Chrome and Firefox cloud results with one repair attem
41084108
41094109test('cloud run controller uses the visible tab and persists terminal status', async () => {
41104110 const session = {};
4111- const tab = { id: 17, url: 'https://webbrain.one/', active: true, windowId: 3 };
4111+ const tab = { id: 17, url: '', pendingUrl: 'https://webbrain.one/', active: true, windowId: 3 };
4112+ let createdTabs = 0;
41124113 let finishRun;
41134114 let processArgs = null;
41144115 const agent = {
@@ -4124,7 +4125,10 @@ test('cloud run controller uses the visible tab and persists terminal status', a
41244125 query: async query => query.active ? [tab] : [tab],
41254126 get: async () => tab,
41264127 update: async () => tab,
4127- create: async () => ({ id: 18, url: 'about:blank', active: true }),
4128+ create: async () => {
4129+ createdTabs += 1;
4130+ return { id: 18, url: 'about:blank', active: true };
4131+ },
41284132 },
41294133 windows: { update: async () => ({}) },
41304134 storage: {
@@ -4146,6 +4150,7 @@ test('cloud run controller uses the visible tab and persists terminal status', a
41464150 const started = await controller.startRun({ task: 'Open Google' });
41474151 assert.equal(started.status, 'running');
41484152 assert.equal(started.tabId, 17);
4153+ assert.equal(createdTabs, 0, 'a loaded pendingUrl tab should be reused instead of opening about:blank');
41494154 assert.equal(processArgs[3], 'act');
41504155 assert.deepEqual(processArgs[4], []);
41514156 assert.equal(processArgs[5].cloudRun, true);
0 commit comments