summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-03 14:49:04 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-03 14:49:04 +0000
commit6a46c340e2b90c300245b73d4e1383bd81cffd82 (patch)
tree7106d3c464560952c5efd09868c6a96df7ab3ca8 /chrome_frame/test
parentdd3c6e8813e90a81662d091dcc47653687e08f28 (diff)
downloadchromium_src-6a46c340e2b90c300245b73d4e1383bd81cffd82.zip
chromium_src-6a46c340e2b90c300245b73d4e1383bd81cffd82.tar.gz
chromium_src-6a46c340e2b90c300245b73d4e1383bd81cffd82.tar.bz2
Share the "get CF profile dir" code between ChromeFramePlugin and chrome_frame_test_utils.h.
This addresses a long-standing TODO. Cleanup is good for the soul. BUG=none Review URL: http://codereview.chromium.org/10197011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-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
7 files changed, 14 insertions, 20 deletions
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,