From f56e69453eced97f31dc23bc72ae883f9e260eee Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Wed, 14 Jul 2010 18:57:48 +0000 Subject: Attempt 2 at fixing the chrome frame net tests hang on the builders. This hang occurs because of a race condition in registering the http/https protocol factories. The net tests registers a protocol factory and the Chrome AutomationResourceMessageFilter also registers factories. If the net tests ends up being first in the chain then the requests are incorrectly dropped. Fix is to register the net tests protocol factory before instantiating the AutomationResourceMessageFilter. TBR=stoyan Review URL: http://codereview.chromium.org/2959013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52366 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/test/net/test_automation_provider.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'chrome_frame') diff --git a/chrome_frame/test/net/test_automation_provider.cc b/chrome_frame/test/net/test_automation_provider.cc index 563a8c1..ef5528a 100644 --- a/chrome_frame/test/net/test_automation_provider.cc +++ b/chrome_frame/test/net/test_automation_provider.cc @@ -29,11 +29,16 @@ TestAutomationProvider::TestAutomationProvider( Profile* profile, TestAutomationProviderDelegate* delegate) : AutomationProvider(profile), tab_handle_(-1), delegate_(delegate) { - filter_ = new TestAutomationResourceMessageFilter(this); + // We need to register the protocol factory before the + // AutomationResourceMessageFilter registers the automation job factory to + // ensure that we don't inadvarently end up handling http requests which + // we don't expect. The initial chrome frame page for the network tests + // issues http requests which our test factory should not handle. URLRequest::RegisterProtocolFactory("http", TestAutomationProvider::Factory); URLRequest::RegisterProtocolFactory("https", TestAutomationProvider::Factory); + filter_ = new TestAutomationResourceMessageFilter(this); g_provider_instance_ = this; } -- cgit v1.1