| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #include "chrome_frame/test/http_server.h" | 5 #include "chrome_frame/test/http_server.h" |
| 5 | 6 |
| 7 #include "base/string_util.h" |
| 8 |
| 6 const wchar_t kDocRoot[] = L"chrome_frame\\test\\data"; | 9 const wchar_t kDocRoot[] = L"chrome_frame\\test\\data"; |
| 7 | 10 |
| 8 void ChromeFrameHTTPServer::SetUp() { | 11 void ChromeFrameHTTPServer::SetUp() { |
| 9 std::wstring document_root(kDocRoot); | 12 std::wstring document_root(kDocRoot); |
| 10 server_ = HTTPTestServer::CreateServer(document_root, NULL, 30, 1000); | 13 server_ = HTTPTestServer::CreateServer(document_root, NULL, 30, 1000); |
| 11 ASSERT_TRUE(server_ != NULL); | 14 ASSERT_TRUE(server_ != NULL); |
| 12 | 15 |
| 13 // copy CFInstance.js into the test directory | 16 // copy CFInstance.js into the test directory |
| 14 FilePath cf_source_path; | 17 FilePath cf_source_path; |
| 15 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path); | 18 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 file_util::Delete(cfi_path, false); | 58 file_util::Delete(cfi_path, false); |
| 56 } | 59 } |
| 57 | 60 |
| 58 bool ChromeFrameHTTPServer::WaitToFinish(int milliseconds) { | 61 bool ChromeFrameHTTPServer::WaitToFinish(int milliseconds) { |
| 59 if (!server_) | 62 if (!server_) |
| 60 return true; | 63 return true; |
| 61 | 64 |
| 62 return server_->WaitToFinish(milliseconds); | 65 return server_->WaitToFinish(milliseconds); |
| 63 } | 66 } |
| 64 | 67 |
| 68 // TODO(phajdan.jr): Change wchar_t* to std::string& and fix callers. |
| 65 GURL ChromeFrameHTTPServer::Resolve(const wchar_t* relative_url) { | 69 GURL ChromeFrameHTTPServer::Resolve(const wchar_t* relative_url) { |
| 66 return server_->TestServerPageW(relative_url); | 70 return server_->TestServerPage(WideToUTF8(relative_url)); |
| 67 } | 71 } |
| 68 | 72 |
| 69 std::wstring ChromeFrameHTTPServer::GetDataDir() { | 73 std::wstring ChromeFrameHTTPServer::GetDataDir() { |
| 70 return server_->GetDataDirectory().ToWStringHack(); | 74 return server_->GetDataDirectory().ToWStringHack(); |
| 71 } | 75 } |
| 72 | 76 |
| OLD | NEW |