kaluchi / speedtracer

Automatically exported from code.google.com/p/speedtracer
0 stars 0 forks source link

Content script race condition in starting connection with background page #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the Breaky test, we are seeing periodic failures that are caused by
a timeout.  What we believe is happening is that there is a race
condition between the time it takes headless_content_script.js to issue a 
chrome.extension.connect() and HeadlessBackgroundPage.java actually creating 
the port.  If the background page is slow to come up, it will never receive 
the onConnect event and further messages from the content script will fail.

A workaround is to start up the browser, wait, then navigate to a new page 
before staring the test.   A more permanent fix would be to put a timeout 
and re-connect in the content script and logic in the background page to 
acknowledge the onConnect event back to the content script.

Original issue reported on code.google.com by zundel@google.com on 13 May 2010 at 3:10

GoogleCodeExporter commented 9 years ago
ref:  2651272

Original comment by zundel@google.com on 13 May 2010 at 3:25