OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/http_server.h" | 5 #include "chrome_frame/test/http_server.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 | 8 |
9 const wchar_t kDocRoot[] = L"chrome_frame\\test\\data"; | 9 const wchar_t kDocRoot[] = L"chrome_frame\\test\\data"; |
10 | 10 |
11 void ChromeFrameHTTPServer::SetUp() { | 11 void ChromeFrameHTTPServer::SetUp() { |
12 std::wstring document_root(kDocRoot); | 12 std::wstring document_root(kDocRoot); |
13 server_ = HTTPTestServer::CreateServer(document_root, NULL, 30, 1000); | 13 server_ = HTTPTestServer::CreateServer(document_root); |
14 ASSERT_TRUE(server_ != NULL); | 14 ASSERT_TRUE(server_ != NULL); |
15 | 15 |
16 // copy CFInstance.js into the test directory | 16 // copy CFInstance.js into the test directory |
17 FilePath cf_source_path; | 17 FilePath cf_source_path; |
18 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path); | 18 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path); |
19 cf_source_path = cf_source_path.Append(FILE_PATH_LITERAL("chrome_frame")); | 19 cf_source_path = cf_source_path.Append(FILE_PATH_LITERAL("chrome_frame")); |
20 | 20 |
21 file_util::CopyFile(cf_source_path.Append(FILE_PATH_LITERAL("CFInstance.js")), | 21 file_util::CopyFile(cf_source_path.Append(FILE_PATH_LITERAL("CFInstance.js")), |
22 cf_source_path.Append( | 22 cf_source_path.Append( |
23 FILE_PATH_LITERAL("test")).Append( | 23 FILE_PATH_LITERAL("test")).Append( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 | 67 |
68 // TODO(phajdan.jr): Change wchar_t* to std::string& and fix callers. | 68 // TODO(phajdan.jr): Change wchar_t* to std::string& and fix callers. |
69 GURL ChromeFrameHTTPServer::Resolve(const wchar_t* relative_url) { | 69 GURL ChromeFrameHTTPServer::Resolve(const wchar_t* relative_url) { |
70 return server_->TestServerPage(WideToUTF8(relative_url)); | 70 return server_->TestServerPage(WideToUTF8(relative_url)); |
71 } | 71 } |
72 | 72 |
73 FilePath ChromeFrameHTTPServer::GetDataDir() { | 73 FilePath ChromeFrameHTTPServer::GetDataDir() { |
74 return server_->GetDataDirectory(); | 74 return server_->GetDataDirectory(); |
75 } | 75 } |
OLD | NEW |