| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome_frame/test/net/test_automation_provider.h" | 5 #include "chrome_frame/test/net/test_automation_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/common/automation_messages.h" | 10 #include "chrome/common/automation_messages.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 g_provider_instance_->tab_handle_, new_id++, | 92 g_provider_instance_->tab_handle_, new_id++, |
| 93 g_provider_instance_->automation_resource_message_filter_, false); | 93 g_provider_instance_->automation_resource_message_filter_, false); |
| 94 return job; | 94 return job; |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 return NULL; | 98 return NULL; |
| 99 } | 99 } |
| 100 | 100 |
| 101 std::string TestAutomationProvider::GetProtocolVersion() { | 101 std::string TestAutomationProvider::GetProtocolVersion() { |
| 102 // Return the version of chrome.dll | 102 // Return the version of npchrome_frame.dll. We used to use |
| 103 // chrome.dll, but the other end of the pipe in this case is |
| 104 // actually npchrome_frame.dll (which fetches its version info from |
| 105 // itself), and occasionally we run into RC dependency problems in |
| 106 // incremental builds so that the version information does not get |
| 107 // updated in one module but does in another, so better to use the |
| 108 // exact same version to avoid hard-to-debug problems in development |
| 109 // builds. |
| 103 FilePath path; | 110 FilePath path; |
| 104 PathService::Get(base::DIR_MODULE, &path); | 111 PathService::Get(base::DIR_MODULE, &path); |
| 105 path = path.AppendASCII("chrome.dll"); | 112 path = path.AppendASCII("npchrome_frame.dll"); |
| 106 | 113 |
| 107 std::string version; | 114 std::string version; |
| 108 scoped_ptr<FileVersionInfo> version_info( | 115 scoped_ptr<FileVersionInfo> version_info( |
| 109 FileVersionInfo::CreateFileVersionInfo(path)); | 116 FileVersionInfo::CreateFileVersionInfo(path)); |
| 110 if (version_info.get()) { | 117 if (version_info.get()) { |
| 111 version = WideToASCII(version_info->product_version()); | 118 version = WideToASCII(version_info->product_version()); |
| 112 } | 119 } |
| 113 return version; | 120 return version; |
| 114 } | 121 } |
| 115 | 122 |
| 116 // static | 123 // static |
| 117 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( | 124 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( |
| 118 Profile* p, const std::string& channel, | 125 Profile* p, const std::string& channel, |
| 119 TestAutomationProviderDelegate* delegate) { | 126 TestAutomationProviderDelegate* delegate) { |
| 120 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); | 127 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); |
| 121 automation->InitializeChannel(channel); | 128 automation->InitializeChannel(channel); |
| 122 automation->SetExpectedTabCount(1); | 129 automation->SetExpectedTabCount(1); |
| 123 return automation; | 130 return automation; |
| 124 } | 131 } |
| OLD | NEW |