summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 04:37:20 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 04:37:20 +0000
commit22a91288c8d235afb45932dd7633982a04c389f0 (patch)
tree431cd53b7ba02ad1d17bf370a7131fc4c308623d /chrome_frame
parent58580359a452cb7c3b9580edc0843c3ab3d158df (diff)
downloadchromium_src-22a91288c8d235afb45932dd7633982a04c389f0.zip
chromium_src-22a91288c8d235afb45932dd7633982a04c389f0.tar.gz
chromium_src-22a91288c8d235afb45932dd7633982a04c389f0.tar.bz2
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
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/net/test_automation_provider.cc18
-rw-r--r--chrome_frame/test/net/test_automation_provider.h3
2 files changed, 20 insertions, 1 deletions
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<FileVersionInfo> 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 <string>
#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_;