From 22a91288c8d235afb45932dd7633982a04c389f0 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Tue, 26 Oct 2010 04:37:20 +0000 Subject: ChromeFrame network tests were broken since the change to honor the automation protocol version in ChromeFrame which basically breaks the automation connection if the protocols don't match. While this is fine when chrome is the automation client, it breaks chrome frame net tests because when the automation channel is established the automation provider sends over the version of the current module in the hello message. In the case when the current module is chrome the version goes over correctly. For chrome frame net tests there is no version string. Hence the channel never gets established. Fix is to retrieve the protocol version via a virtual protected function in the automation provider. The testing automation provider overrides this function in the network tests and returns the version of chrome.dll TBR=amit,robertshield Review URL: http://codereview.chromium.org/4160002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63860 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/test/net/test_automation_provider.cc | 18 +++++++++++++++++- chrome_frame/test/net/test_automation_provider.h | 3 +++ 2 files changed, 20 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 322bf87..7594f30 100644 --- a/chrome_frame/test/net/test_automation_provider.cc +++ b/chrome_frame/test/net/test_automation_provider.cc @@ -5,8 +5,9 @@ #include "chrome_frame/test/net/test_automation_provider.h" #include "base/command_line.h" +#include "base/file_version_info.h" +#include "base/path_service.h" #include "chrome/test/automation/automation_messages.h" - #include "chrome_frame/test/net/test_automation_resource_message_filter.h" namespace { @@ -98,6 +99,21 @@ URLRequestJob* TestAutomationProvider::Factory(URLRequest* request, return NULL; } +std::string TestAutomationProvider::GetProtocolVersion() { + // Return the version of chrome.dll + FilePath path; + PathService::Get(base::DIR_MODULE, &path); + path = path.AppendASCII("chrome.dll"); + + std::string version; + scoped_ptr version_info( + FileVersionInfo::CreateFileVersionInfo(path)); + if (version_info.get()) { + version = WideToASCII(version_info->product_version()); + } + return version; +} + // static TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( Profile* p, const std::string& channel, diff --git a/chrome_frame/test/net/test_automation_provider.h b/chrome_frame/test/net/test_automation_provider.h index d462108..9d3f65b 100644 --- a/chrome_frame/test/net/test_automation_provider.h +++ b/chrome_frame/test/net/test_automation_provider.h @@ -4,6 +4,7 @@ #ifndef CHROME_FRAME_TEST_NET_TEST_AUTOMATION_PROVIDER_H_ #define CHROME_FRAME_TEST_NET_TEST_AUTOMATION_PROVIDER_H_ +#include #include "chrome/browser/automation/automation_provider.h" class TestAutomationResourceMessageFilter; @@ -47,6 +48,8 @@ class TestAutomationProvider TestAutomationProviderDelegate* delegate); protected: + virtual std::string GetProtocolVersion(); + int tab_handle_; TestAutomationProviderDelegate* delegate_; -- cgit v1.1