summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/chrome_frame_plugin.h4
-rw-r--r--chrome_frame/test/automation_client_mock.cc2
-rw-r--r--chrome_frame/test/automation_client_mock.h8
-rw-r--r--chrome_frame/test/chrome_frame_automation_mock.h4
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc9
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.h2
-rw-r--r--chrome_frame/test/delete_chrome_history_test.cc5
-rw-r--r--chrome_frame/test/proxy_factory_mock.cc4
-rw-r--r--chrome_frame/utils.cc7
-rw-r--r--chrome_frame/utils.h5
10 files changed, 27 insertions, 23 deletions
diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h
index e71cb2f..5182698 100644
--- a/chrome_frame/chrome_frame_plugin.h
+++ b/chrome_frame/chrome_frame_plugin.h
@@ -240,9 +240,7 @@ END_MSG_MAP()
virtual void GetProfilePath(const std::wstring& profile_name,
FilePath* profile_path) {
- chrome::GetChromeFrameUserDataDirectory(profile_path);
- *profile_path = profile_path->Append(profile_name);
- DVLOG(1) << __FUNCTION__ << ": " << profile_path->value();
+ return GetChromeFrameProfilePath(profile_name, profile_path);
}
protected:
diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc
index 94a836b..bcd63a7 100644
--- a/chrome_frame/test/automation_client_mock.cc
+++ b/chrome_frame/test/automation_client_mock.cc
@@ -123,7 +123,7 @@ FilePath CFACWithChrome::profile_path_;
// static
void CFACWithChrome::SetUpTestCase() {
- profile_path_ = chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter");
+ GetChromeFrameProfilePath(L"Adam.N.Epilinter", &profile_path_);
}
// static
diff --git a/chrome_frame/test/automation_client_mock.h b/chrome_frame/test/automation_client_mock.h
index 986d56a..4cd89dc 100644
--- a/chrome_frame/test/automation_client_mock.h
+++ b/chrome_frame/test/automation_client_mock.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,6 +12,7 @@
#include "chrome_frame/chrome_frame_automation.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/proxy_factory_mock.h"
+#include "chrome_frame/utils.h"
#include "gmock/gmock.h"
using testing::StrictMock;
@@ -169,9 +170,8 @@ class CFACMockTest : public testing::Test {
protected:
CFACMockTest()
: tracker_(NULL), timeout_(500),
- returned_proxy_(static_cast<ChromeFrameAutomationProxy*>(&mock_proxy_)),
- profile_path_(
- chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")) {
+ returned_proxy_(static_cast<ChromeFrameAutomationProxy*>(&mock_proxy_)) {
+ GetChromeFrameProfilePath(L"Adam.N.Epilinter", &profile_path_);
id_ = reinterpret_cast<void*>(5);
tab_handle_ = 3;
}
diff --git a/chrome_frame/test/chrome_frame_automation_mock.h b/chrome_frame/test/chrome_frame_automation_mock.h
index deb625c..a26d3074 100644
--- a/chrome_frame/test/chrome_frame_automation_mock.h
+++ b/chrome_frame/test/chrome_frame_automation_mock.h
@@ -41,8 +41,8 @@ class AutomationMockDelegate
mock_server_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE));
- FilePath profile_path(
- chrome_frame_test::GetProfilePath(profile_name));
+ FilePath profile_path;
+ GetChromeFrameProfilePath(profile_name, &profile_path);
chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value());
automation_client_ = new ChromeFrameAutomationClient;
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 1348b1a..8544a17 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -413,13 +413,6 @@ HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser) {
return hr;
}
-// TODO(joi@chromium.org) Could share this code with chrome_frame_plugin.h
-FilePath GetProfilePath(const std::wstring& profile_name) {
- FilePath profile_path;
- chrome::GetChromeFrameUserDataDirectory(&profile_path);
- return profile_path.Append(profile_name);
-}
-
std::wstring GetExeVersion(const std::wstring& exe_path) {
scoped_ptr<FileVersionInfo> ie_version_info(
FileVersionInfo::CreateFileVersionInfo(FilePath(exe_path)));
@@ -458,7 +451,7 @@ FilePath GetProfilePathForIE() {
profile_path = GetIETemporaryFilesFolder();
profile_path = profile_path.Append(L"Google Chrome Frame");
} else {
- profile_path = GetProfilePath(kIEProfileName);
+ GetChromeFrameProfilePath(kIEProfileName, &profile_path);
}
return profile_path;
}
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h
index 1d4d479..b4ef4fd 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -281,8 +281,6 @@ class TimedMsgLoop {
// Returns S_OK on success.
HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser);
-FilePath GetProfilePath(const std::wstring& suffix);
-
// Returns the path of the exe passed in.
std::wstring GetExecutableAppPath(const std::wstring& file);
diff --git a/chrome_frame/test/delete_chrome_history_test.cc b/chrome_frame/test/delete_chrome_history_test.cc
index 75fa48b..ee4cfcf 100644
--- a/chrome_frame/test/delete_chrome_history_test.cc
+++ b/chrome_frame/test/delete_chrome_history_test.cc
@@ -97,9 +97,10 @@ const size_t kBlankPngFileLength = 95;
// Looks up |element_name| in the Chrome form data DB and ensures that the
// results match |matcher|.
ACTION_P2(ExpectFormValuesForElementNameMatch, element_name, matcher) {
+ FilePath root_path;
+ GetChromeFrameProfilePath(kIexploreProfileName, &root_path);
FilePath profile_path(
- chrome_frame_test::GetProfilePath(kIexploreProfileName)
- .Append(L"Default").Append(chrome::kWebDataFilename));
+ root_path.Append(L"Default").Append(chrome::kWebDataFilename));
WebDatabase web_database;
sql::InitStatus init_status = web_database.Init(profile_path);
diff --git a/chrome_frame/test/proxy_factory_mock.cc b/chrome_frame/test/proxy_factory_mock.cc
index dc7e33f..9bb4f2e 100644
--- a/chrome_frame/test/proxy_factory_mock.cc
+++ b/chrome_frame/test/proxy_factory_mock.cc
@@ -9,6 +9,7 @@
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/proxy_factory_mock.h"
#include "chrome_frame/test/test_scrubber.h"
+#include "chrome_frame/utils.h"
#define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
#include "testing/gmock_mutant.h"
@@ -33,7 +34,8 @@ void ProxyFactoryTest::SetUp() {
ChromeFrameLaunchParams* ProxyFactoryTest::MakeLaunchParams(
const wchar_t* profile_name) {
GURL empty;
- FilePath profile_path(chrome_frame_test::GetProfilePath(profile_name));
+ FilePath profile_path;
+ GetChromeFrameProfilePath(profile_name, &profile_path);
chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value());
ChromeFrameLaunchParams* params =
new ChromeFrameLaunchParams(empty, empty, profile_path,
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index 8f98b31..dc8d24c 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -1671,3 +1671,10 @@ bool IncreaseWinInetConnections(DWORD connections) {
wininet_connection_count_updated = true;
return true;
}
+
+void GetChromeFrameProfilePath(const string16& profile_name,
+ FilePath* profile_path) {
+ chrome::GetChromeFrameUserDataDirectory(profile_path);
+ *profile_path = profile_path->Append(profile_name);
+ DVLOG(1) << __FUNCTION__ << ": " << profile_path->value();
+}
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h
index d9f6580..a741b65 100644
--- a/chrome_frame/utils.h
+++ b/chrome_frame/utils.h
@@ -621,4 +621,9 @@ bool IsChromeFrameDocument(IWebBrowser2* web_browser);
// Returns true on success.
bool IncreaseWinInetConnections(DWORD connections);
+// Sets |profile_path| to the path for the Chrome Frame |profile_name|
+// profile.
+void GetChromeFrameProfilePath(const string16& profile_name,
+ FilePath* profile_path);
+
#endif // CHROME_FRAME_UTILS_H_