OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 std::string TestAutomationProvider::GetProtocolVersion() { | 107 std::string TestAutomationProvider::GetProtocolVersion() { |
108 // Return the version of npchrome_frame.dll. We used to use | 108 // Return the version of npchrome_frame.dll. We used to use |
109 // chrome.dll, but the other end of the pipe in this case is | 109 // chrome.dll, but the other end of the pipe in this case is |
110 // actually npchrome_frame.dll (which fetches its version info from | 110 // actually npchrome_frame.dll (which fetches its version info from |
111 // itself), and occasionally we run into RC dependency problems in | 111 // itself), and occasionally we run into RC dependency problems in |
112 // incremental builds so that the version information does not get | 112 // incremental builds so that the version information does not get |
113 // updated in one module but does in another, so better to use the | 113 // updated in one module but does in another, so better to use the |
114 // exact same version to avoid hard-to-debug problems in development | 114 // exact same version to avoid hard-to-debug problems in development |
115 // builds. | 115 // builds. |
116 FilePath path; | 116 base::FilePath path; |
117 PathService::Get(base::DIR_MODULE, &path); | 117 PathService::Get(base::DIR_MODULE, &path); |
118 path = path.AppendASCII("npchrome_frame.dll"); | 118 path = path.AppendASCII("npchrome_frame.dll"); |
119 | 119 |
120 std::string version; | 120 std::string version; |
121 scoped_ptr<FileVersionInfo> version_info( | 121 scoped_ptr<FileVersionInfo> version_info( |
122 FileVersionInfo::CreateFileVersionInfo(path)); | 122 FileVersionInfo::CreateFileVersionInfo(path)); |
123 if (version_info.get()) { | 123 if (version_info.get()) { |
124 version = WideToASCII(version_info->product_version()); | 124 version = WideToASCII(version_info->product_version()); |
125 } | 125 } |
126 return version; | 126 return version; |
127 } | 127 } |
128 | 128 |
129 // static | 129 // static |
130 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( | 130 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( |
131 Profile* p, const std::string& channel, | 131 Profile* p, const std::string& channel, |
132 TestAutomationProviderDelegate* delegate) { | 132 TestAutomationProviderDelegate* delegate) { |
133 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); | 133 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); |
134 automation->InitializeChannel(channel); | 134 automation->InitializeChannel(channel); |
135 automation->SetExpectedTabCount(1); | 135 automation->SetExpectedTabCount(1); |
136 return automation; | 136 return automation; |
137 } | 137 } |
OLD | NEW |