Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome_frame/test/http_server.cc

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/http_server.h ('k') | chrome_frame/test/icu_stubs_unittests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 #include "chrome_frame/test/http_server.h"
5
6 const wchar_t kDocRoot[] = L"chrome_frame\\test\\data";
7
8 void ChromeFrameHTTPServer::SetUp() {
9 std::wstring document_root(kDocRoot);
10 server_ = HTTPTestServer::CreateServer(document_root, NULL, 30, 1000);
11 ASSERT_TRUE(server_ != NULL);
12
13 // copy CFInstance.js into the test directory
14 FilePath cf_source_path;
15 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path);
16 cf_source_path = cf_source_path.Append(FILE_PATH_LITERAL("chrome_frame"));
17
18 file_util::CopyFile(cf_source_path.Append(FILE_PATH_LITERAL("CFInstance.js")),
19 cf_source_path.Append(
20 FILE_PATH_LITERAL("test")).Append(
21 FILE_PATH_LITERAL("data")).Append(
22 FILE_PATH_LITERAL("CFInstance.js"))); // NOLINT
23 }
24
25 void ChromeFrameHTTPServer::TearDown() {
26 if (server_) {
27 server_ = NULL;
28 }
29
30 // clobber CFInstance.js
31 FilePath cfi_path;
32 PathService::Get(base::DIR_SOURCE_ROOT, &cfi_path);
33 cfi_path = cfi_path
34 .Append(FILE_PATH_LITERAL("chrome_frame"))
35 .Append(FILE_PATH_LITERAL("test"))
36 .Append(FILE_PATH_LITERAL("data"))
37 .Append(FILE_PATH_LITERAL("CFInstance.js"));
38
39 file_util::Delete(cfi_path, false);
40 }
41
42 bool ChromeFrameHTTPServer::WaitToFinish(int milliseconds) {
43 if (!server_)
44 return true;
45
46 return server_->WaitToFinish(milliseconds);
47 }
48
49 GURL ChromeFrameHTTPServer::Resolve(const wchar_t* relative_url) {
50 return server_->TestServerPageW(relative_url);
51 }
52
53 std::wstring ChromeFrameHTTPServer::GetDataDir() {
54 return server_->GetDataDirectory().ToWStringHack();
55 }
56
OLDNEW
« no previous file with comments | « chrome_frame/test/http_server.h ('k') | chrome_frame/test/icu_stubs_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698