summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 20:32:19 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 20:32:19 +0000
commit158a0892d261b8c717f2bc92bec4649898e4da96 (patch)
treea9ffd69181f6798160a59384d2e6088771364c29 /chrome/browser
parent866ba3fc1097334050b59b919e12e11314f2965d (diff)
downloadchromium_src-158a0892d261b8c717f2bc92bec4649898e4da96.zip
chromium_src-158a0892d261b8c717f2bc92bec4649898e4da96.tar.gz
chromium_src-158a0892d261b8c717f2bc92bec4649898e4da96.tar.bz2
Use FilePath in URLRequestMocks.
BUG=24672 TEST=compiles Review URL: http://codereview.chromium.org/271066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_encoding_uitest.cc6
-rw-r--r--chrome/browser/download/download_uitest.cc11
-rw-r--r--chrome/browser/download/save_page_browsertest.cc6
-rw-r--r--chrome/browser/download/save_page_uitest.cc4
-rw-r--r--chrome/browser/errorpage_uitest.cc48
-rw-r--r--chrome/browser/net/url_request_mock_http_job.cc17
-rw-r--r--chrome/browser/net/url_request_mock_http_job.h10
-rw-r--r--chrome/browser/net/url_request_mock_util.cc2
-rw-r--r--chrome/browser/net/url_request_slow_http_job.cc8
-rw-r--r--chrome/browser/net/url_request_slow_http_job.h6
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc3
-rw-r--r--chrome/browser/unload_uitest.cc12
12 files changed, 78 insertions, 55 deletions
diff --git a/chrome/browser/browser_encoding_uitest.cc b/chrome/browser/browser_encoding_uitest.cc
index 980aa30..8d68314 100644
--- a/chrome/browser/browser_encoding_uitest.cc
+++ b/chrome/browser/browser_encoding_uitest.cc
@@ -98,7 +98,7 @@ TEST_F(BrowserEncodingTest, TestEncodingAliasMapping) {
test_file_path = test_file_path.AppendASCII(
kEncodingTestDatas[i].file_name);
GURL url =
- URLRequestMockHTTPJob::GetMockUrl(test_file_path.ToWStringHack());
+ URLRequestMockHTTPJob::GetMockUrl(test_file_path);
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
@@ -123,7 +123,7 @@ TEST_F(BrowserEncodingTest, TestOverrideEncoding) {
FilePath test_dir_path = FilePath(kTestDir).AppendASCII(kOverrideTestDir);
test_dir_path = test_dir_path.AppendASCII(kTestFileName);
- GURL url = URLRequestMockHTTPJob::GetMockUrl(test_dir_path.ToWStringHack());
+ GURL url = URLRequestMockHTTPJob::GetMockUrl(test_dir_path);
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
ASSERT_TRUE(tab_proxy->NavigateToURL(url));
@@ -250,7 +250,7 @@ TEST_F(BrowserEncodingTest, TestEncodingAutoDetect) {
FilePath test_file_path(test_dir_path);
test_file_path = test_file_path.AppendASCII(kTestDatas[i].test_file_name);
GURL url =
- URLRequestMockHTTPJob::GetMockUrl(test_file_path.ToWStringHack());
+ URLRequestMockHTTPJob::GetMockUrl(test_file_path);
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilTabCount(1);
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc
index 107e79c..f35fd5c 100644
--- a/chrome/browser/download/download_uitest.cc
+++ b/chrome/browser/download/download_uitest.cc
@@ -181,7 +181,7 @@ TEST_F(DownloadTest, DownloadMimeType) {
EXPECT_EQ(1, GetTabCount());
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file.ToWStringHack()));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file));
// No new tabs created, downloads appear in the current tab's download shelf.
WaitUntilTabCount(1);
@@ -206,7 +206,7 @@ TEST_F(DownloadTest, NoDownload) {
EXPECT_EQ(1, GetTabCount());
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file.ToWStringHack()));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file));
WaitUntilTabCount(1);
// Wait to see if the file will be downloaded.
@@ -230,7 +230,7 @@ TEST_F(DownloadTest, ContentDisposition) {
EXPECT_EQ(1, GetTabCount());
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file.ToWStringHack()));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file));
WaitUntilTabCount(1);
// Wait until the file is downloaded.
@@ -253,7 +253,7 @@ TEST_F(DownloadTest, PerWindowShelf) {
EXPECT_EQ(1, GetTabCount());
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file.ToWStringHack()));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file));
WaitUntilTabCount(1);
// Wait until the file is downloaded.
@@ -336,8 +336,7 @@ TEST_F(DownloadTest, FLAKY_IncognitoDownload) {
// Download something.
FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
//PlatformThread::Sleep(1000);
- ASSERT_TRUE(tab->NavigateToURL(
- URLRequestMockHTTPJob::GetMockUrl(file.ToWStringHack())));
+ ASSERT_TRUE(tab->NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file)));
PlatformThread::Sleep(action_timeout_ms());
// Verify that the download shelf is showing for the Incognito window.
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index dbe7807..9bc7203 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -80,7 +80,7 @@ class SavePageBrowserTest : public InProcessBrowserTest {
IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveHTMLOnly) {
FilePath file_name(FILE_PATH_LITERAL("a.htm"));
GURL url = URLRequestMockHTTPJob::GetMockUrl(
- FilePath(kTestDir).Append(file_name).ToWStringHack());
+ FilePath(kTestDir).Append(file_name));
ui_test_utils::NavigateToURL(browser(), url);
TabContents* current_tab = browser()->GetSelectedTabContents();
@@ -105,7 +105,7 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveHTMLOnly) {
IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveCompleteHTML) {
FilePath file_name(FILE_PATH_LITERAL("b.htm"));
GURL url = URLRequestMockHTTPJob::GetMockUrl(
- FilePath(kTestDir).Append(file_name).ToWStringHack());
+ FilePath(kTestDir).Append(file_name));
ui_test_utils::NavigateToURL(browser(), url);
TabContents* current_tab = browser()->GetSelectedTabContents();
@@ -146,7 +146,7 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, FileNameFromPageTitle) {
FilePath file_name(FILE_PATH_LITERAL("b.htm"));
GURL url = URLRequestMockHTTPJob::GetMockUrl(
- FilePath(kTestDir).Append(file_name).ToWStringHack());
+ FilePath(kTestDir).Append(file_name));
ui_test_utils::NavigateToURL(browser(), url);
FilePath full_file_name = save_dir_.path().AppendASCII(
diff --git a/chrome/browser/download/save_page_uitest.cc b/chrome/browser/download/save_page_uitest.cc
index fbed636..8774637 100644
--- a/chrome/browser/download/save_page_uitest.cc
+++ b/chrome/browser/download/save_page_uitest.cc
@@ -68,8 +68,8 @@ TEST_F(SavePageTest, CleanFilenameFromPageTitle) {
download_dir_.AppendASCII(std::string("test.exe") + kAppendedExtension);
FilePath dir = download_dir_.AppendASCII("test.exe_files");
- GURL url = URLRequestMockHTTPJob::GetMockUrl(
- UTF8ToWide(std::string(kTestDir) + "/" + file_name));
+ GURL url = URLRequestMockHTTPJob::GetMockUrl(FilePath(ASCIIToWide(
+ std::string(kTestDir) + "/" + file_name)));
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(url));
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc
index 3ee8fec..6c162aa 100644
--- a/chrome/browser/errorpage_uitest.cc
+++ b/chrome/browser/errorpage_uitest.cc
@@ -50,7 +50,8 @@ TEST_F(ErrorPageTest, DNSError_GoBack1) {
// additional session history entry.
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
// The first navigation should fail, and the second one should be the error
// page.
NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
@@ -71,12 +72,14 @@ TEST_F(ErrorPageTest, DNSError_GoBack2) {
// additional session history entry.
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
// The first navigation should fail, and the second one should be the error
// page.
NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title3.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title3.html"))));
// The first navigation should fail, and the second one should be the error
// page.
@@ -98,12 +101,14 @@ TEST_F(ErrorPageTest, DNSError_GoBack2AndForward) {
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
// The first navigation should fail, and the second one should be the error
// page.
NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title3.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title3.html"))));
// The first navigation should fail, and the second one should be the error
// page.
@@ -128,12 +133,14 @@ TEST_F(ErrorPageTest, DNSError_GoBack2Forward2) {
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title3.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title3.html"))));
// The first navigation should fail, and the second one should be the error
// page.
NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
// The first navigation should fail, and the second one should be the error
// page.
@@ -155,7 +162,8 @@ TEST_F(ErrorPageTest, IFrameDNSError_Basic) {
if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA)
return;
#endif // defined(OS_WIN)
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"iframe_dns_error.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("iframe_dns_error.html"))));
EXPECT_TRUE(WaitForTitleMatching(L"Blah"));
}
@@ -168,8 +176,10 @@ TEST_F(ErrorPageTest, IFrameDNSError_GoBack) {
// Test that a DNS error occuring in an iframe does not result in an
// additional session history entry.
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"iframe_dns_error.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("iframe_dns_error.html"))));
EXPECT_TRUE(GetActiveTab()->GoBack());
@@ -185,8 +195,10 @@ TEST_F(ErrorPageTest, IFrameDNSError_GoBackAndForward) {
// Test that a DNS error occuring in an iframe does not result in an
// additional session history entry.
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"iframe_dns_error.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("iframe_dns_error.html"))));
EXPECT_TRUE(GetActiveTab()->GoBack());
EXPECT_TRUE(GetActiveTab()->GoForward());
@@ -219,11 +231,13 @@ TEST_F(ErrorPageTest, Page404) {
if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA)
return;
#endif // defined(OS_WIN)
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
// The first navigation should fail, and the second one should be the error
// page.
NavigateToURLBlockUntilNavigationsComplete(
- URLRequestMockHTTPJob::GetMockUrl(L"page404.html"), 2);
+ URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("page404.html"))), 2);
EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor"));
}
@@ -234,11 +248,13 @@ TEST_F(ErrorPageTest, Page404_GoBack) {
if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA)
return;
#endif // defined(OS_WIN)
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
// The first navigation should fail, and the second one should be the error
// page.
NavigateToURLBlockUntilNavigationsComplete(
- URLRequestMockHTTPJob::GetMockUrl(L"page404.html"), 2);
+ URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("page404.html"))), 2);
EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor"));
EXPECT_TRUE(GetActiveTab()->GoBack());
diff --git a/chrome/browser/net/url_request_mock_http_job.cc b/chrome/browser/net/url_request_mock_http_job.cc
index 7e0cd71..5887a55 100644
--- a/chrome/browser/net/url_request_mock_http_job.cc
+++ b/chrome/browser/net/url_request_mock_http_job.cc
@@ -12,9 +12,10 @@
#include "net/url_request/url_request_filter.h"
static const char kMockHostname[] = "mock.http";
-static const wchar_t kMockHeaderFileSuffix[] = L".mock-http-headers";
+static const FilePath::CharType kMockHeaderFileSuffix[] =
+ FILE_PATH_LITERAL(".mock-http-headers");
-std::wstring URLRequestMockHTTPJob::base_path_ = L"";
+FilePath URLRequestMockHTTPJob::base_path_;
/* static */
URLRequestJob* URLRequestMockHTTPJob::Factory(URLRequest* request,
@@ -24,7 +25,7 @@ URLRequestJob* URLRequestMockHTTPJob::Factory(URLRequest* request,
}
/* static */
-void URLRequestMockHTTPJob::AddUrlHandler(const std::wstring& base_path) {
+void URLRequestMockHTTPJob::AddUrlHandler(const FilePath& base_path) {
base_path_ = base_path;
// Add kMockHostname to URLRequestFilter.
@@ -34,20 +35,20 @@ void URLRequestMockHTTPJob::AddUrlHandler(const std::wstring& base_path) {
}
/* static */
-GURL URLRequestMockHTTPJob::GetMockUrl(const std::wstring& path) {
+GURL URLRequestMockHTTPJob::GetMockUrl(const FilePath& path) {
std::string url = "http://";
url.append(kMockHostname);
url.append("/");
- url.append(WideToUTF8(path));
+ url.append(WideToUTF8(path.ToWStringHack()));
return GURL(url);
}
/* static */
-FilePath URLRequestMockHTTPJob::GetOnDiskPath(const std::wstring& base_path,
+FilePath URLRequestMockHTTPJob::GetOnDiskPath(const FilePath& base_path,
URLRequest* request,
const std::string& scheme) {
std::string file_url("file:///");
- file_url += WideToUTF8(base_path);
+ file_url += WideToUTF8(base_path.ToWStringHack());
file_url += request->url().path();
// Convert the file:/// URL to a path on disk.
@@ -76,7 +77,7 @@ bool URLRequestMockHTTPJob::IsRedirectResponse(GURL* location,
// Private const version.
void URLRequestMockHTTPJob::GetResponseInfoConst(
net::HttpResponseInfo* info) const {
- std::wstring header_file = file_path_.ToWStringHack() + kMockHeaderFileSuffix;
+ FilePath header_file = FilePath(file_path_.value() + kMockHeaderFileSuffix);
std::string raw_headers;
if (!file_util::ReadFileToString(header_file, &raw_headers))
return;
diff --git a/chrome/browser/net/url_request_mock_http_job.h b/chrome/browser/net/url_request_mock_http_job.h
index 92cc359..b5ef740 100644
--- a/chrome/browser/net/url_request_mock_http_job.h
+++ b/chrome/browser/net/url_request_mock_http_job.h
@@ -11,6 +11,8 @@
#include "net/url_request/url_request_file_job.h"
+class FilePath;
+
class URLRequestMockHTTPJob : public URLRequestFileJob {
public:
URLRequestMockHTTPJob(URLRequest* request, const FilePath& file_path);
@@ -24,13 +26,13 @@ class URLRequestMockHTTPJob : public URLRequestFileJob {
static URLRequest::ProtocolFactory Factory;
// Adds the testing URLs to the URLRequestFilter.
- static void AddUrlHandler(const std::wstring& base_path);
+ static void AddUrlHandler(const FilePath& base_path);
// Given the path to a file relative to base_path_, construct a mock URL.
- static GURL GetMockUrl(const std::wstring& path);
+ static GURL GetMockUrl(const FilePath& path);
protected:
- static FilePath GetOnDiskPath(const std::wstring& base_path,
+ static FilePath GetOnDiskPath(const FilePath& base_path,
URLRequest* request,
const std::string& scheme);
@@ -39,7 +41,7 @@ class URLRequestMockHTTPJob : public URLRequestFileJob {
// This is the file path leading to the root of the directory to use as the
// root of the http server.
- static std::wstring base_path_;
+ static FilePath base_path_;
};
# endif // CHROME_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_
diff --git a/chrome/browser/net/url_request_mock_util.cc b/chrome/browser/net/url_request_mock_util.cc
index 680ed1d..05ec594 100644
--- a/chrome/browser/net/url_request_mock_util.cc
+++ b/chrome/browser/net/url_request_mock_util.cc
@@ -30,7 +30,7 @@ void SetUrlRequestMocksEnabled(bool enabled) {
URLRequestMockLinkDoctorJob::AddUrlHandler();
URLRequestSlowDownloadJob::AddUrlHandler();
- std::wstring root_http;
+ FilePath root_http;
PathService::Get(chrome::DIR_TEST_DATA, &root_http);
URLRequestMockHTTPJob::AddUrlHandler(root_http);
URLRequestSlowHTTPJob::AddUrlHandler(root_http);
diff --git a/chrome/browser/net/url_request_slow_http_job.cc b/chrome/browser/net/url_request_slow_http_job.cc
index 02a3b2b..2ae0f13 100644
--- a/chrome/browser/net/url_request_slow_http_job.cc
+++ b/chrome/browser/net/url_request_slow_http_job.cc
@@ -11,7 +11,7 @@
static const char kMockHostname[] = "mock.slow.http";
-std::wstring URLRequestSlowHTTPJob::base_path_ = L"";
+FilePath URLRequestSlowHTTPJob::base_path_;
// static
const int URLRequestSlowHTTPJob::kDelayMs = 1000;
@@ -26,7 +26,7 @@ URLRequestJob* URLRequestSlowHTTPJob::Factory(URLRequest* request,
}
/* static */
-void URLRequestSlowHTTPJob::AddUrlHandler(const std::wstring& base_path) {
+void URLRequestSlowHTTPJob::AddUrlHandler(const FilePath& base_path) {
base_path_ = base_path;
// Add kMockHostname to URLRequestFilter.
@@ -36,11 +36,11 @@ void URLRequestSlowHTTPJob::AddUrlHandler(const std::wstring& base_path) {
}
/* static */
-GURL URLRequestSlowHTTPJob::GetMockUrl(const std::wstring& path) {
+GURL URLRequestSlowHTTPJob::GetMockUrl(const FilePath& path) {
std::string url = "http://";
url.append(kMockHostname);
url.append("/");
- url.append(WideToUTF8(path));
+ url.append(WideToUTF8(path.ToWStringHack()));
return GURL(url);
}
diff --git a/chrome/browser/net/url_request_slow_http_job.h b/chrome/browser/net/url_request_slow_http_job.h
index d51e2d2..5385ff8 100644
--- a/chrome/browser/net/url_request_slow_http_job.h
+++ b/chrome/browser/net/url_request_slow_http_job.h
@@ -21,10 +21,10 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {
static URLRequest::ProtocolFactory Factory;
// Adds the testing URLs to the URLRequestFilter.
- static void AddUrlHandler(const std::wstring& base_path);
+ static void AddUrlHandler(const FilePath& base_path);
// Given the path to a file relative to base_path_, construct a mock URL.
- static GURL GetMockUrl(const std::wstring& path);
+ static GURL GetMockUrl(const FilePath& path);
virtual void Start();
@@ -35,7 +35,7 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {
// This is the file path leading to the root of the directory to use as the
// root of the http server.
- static std::wstring base_path_;
+ static FilePath base_path_;
};
# endif // CHROME_BROWSER_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 5d0f07c..086dd50 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -24,7 +24,8 @@ class ResourceDispatcherTest : public UITest {
public:
void CheckTitleTest(const std::wstring& file,
const std::wstring& expected_title) {
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath::FromWStringHack(file)));
const int kCheckDelayMs = 100;
int max_wait_time = 5000;
while (max_wait_time > 0) {
diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc
index b79a356..86d0a82 100644
--- a/chrome/browser/unload_uitest.cc
+++ b/chrome/browser/unload_uitest.cc
@@ -123,9 +123,11 @@ class UnloadTest : public UITest {
}
void NavigateToNolistenersFileTwice() {
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
CheckTitle(L"Title Of Awesomeness");
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
CheckTitle(L"Title Of Awesomeness");
}
@@ -137,10 +139,12 @@ class UnloadTest : public UITest {
// if we don't sleep here.
PlatformThread::Sleep(400);
NavigateToURLAsync(
- URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
PlatformThread::Sleep(400);
NavigateToURL(
- URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
+ URLRequestMockHTTPJob::GetMockUrl(
+ FilePath(FILE_PATH_LITERAL("title2.html"))));
CheckTitle(L"Title Of Awesomeness");
}