summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/chrome_frame_automation_mock.h6
-rw-r--r--chrome_frame/test/http_server.cc73
-rw-r--r--chrome_frame/test/http_server.h33
-rw-r--r--chrome_frame/test/test_with_web_server.h1
-rw-r--r--chrome_frame/test/url_request_test.cc15
5 files changed, 9 insertions, 119 deletions
diff --git a/chrome_frame/test/chrome_frame_automation_mock.h b/chrome_frame/test/chrome_frame_automation_mock.h
index 4ba65e2..6c05a5f 100644
--- a/chrome_frame/test/chrome_frame_automation_mock.h
+++ b/chrome_frame/test/chrome_frame_automation_mock.h
@@ -1,6 +1,7 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
+
#ifndef CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_
#define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_
@@ -12,7 +13,6 @@
#include "chrome_frame/chrome_frame_automation.h"
#include "chrome_frame/chrome_frame_plugin.h"
#include "chrome_frame/navigation_constraints.h"
-#include "chrome_frame/test/http_server.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/test_with_web_server.h"
#include "chrome_frame/utils.h"
@@ -231,6 +231,4 @@ class AutomationMockHostNetworkRequestStart
bool request_start_result_;
};
-
#endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_
-
diff --git a/chrome_frame/test/http_server.cc b/chrome_frame/test/http_server.cc
deleted file mode 100644
index 63da6ad..0000000
--- a/chrome_frame/test/http_server.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "chrome_frame/test/http_server.h"
-
-#include "base/base_paths.h"
-#include "base/file_util.h"
-#include "base/path_service.h"
-#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-const wchar_t kDocRoot[] = L"chrome_frame\\test\\data";
-
-ChromeFrameHTTPServer::ChromeFrameHTTPServer()
- : test_server_(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)) {
-}
-
-void ChromeFrameHTTPServer::SetUp() {
- ASSERT_TRUE(test_server_.Start());
-
- // copy CFInstance.js into the test directory
- FilePath cf_source_path;
- PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path);
- cf_source_path = cf_source_path.Append(FILE_PATH_LITERAL("chrome_frame"));
-
- file_util::CopyFile(cf_source_path.Append(FILE_PATH_LITERAL("CFInstance.js")),
- cf_source_path.Append(
- FILE_PATH_LITERAL("test")).Append(
- FILE_PATH_LITERAL("data")).Append(
- FILE_PATH_LITERAL("CFInstance.js"))); // NOLINT
-
- file_util::CopyFile(cf_source_path.Append(FILE_PATH_LITERAL("CFInstall.js")),
- cf_source_path.Append(
- FILE_PATH_LITERAL("test")).Append(
- FILE_PATH_LITERAL("data")).Append(
- FILE_PATH_LITERAL("CFInstall.js"))); // NOLINT
-}
-
-void ChromeFrameHTTPServer::TearDown() {
- test_server_.Stop();
-
- // clobber CFInstance.js
- FilePath cfi_path;
- PathService::Get(base::DIR_SOURCE_ROOT, &cfi_path);
- cfi_path = cfi_path
- .Append(FILE_PATH_LITERAL("chrome_frame"))
- .Append(FILE_PATH_LITERAL("test"))
- .Append(FILE_PATH_LITERAL("data"))
- .Append(FILE_PATH_LITERAL("CFInstance.js"));
-
- file_util::Delete(cfi_path, false);
-
- cfi_path.empty();
- PathService::Get(base::DIR_SOURCE_ROOT, &cfi_path);
- cfi_path = cfi_path
- .Append(FILE_PATH_LITERAL("chrome_frame"))
- .Append(FILE_PATH_LITERAL("test"))
- .Append(FILE_PATH_LITERAL("data"))
- .Append(FILE_PATH_LITERAL("CFInstall.js"));
-
- file_util::Delete(cfi_path, false);
-}
-
-// TODO(phajdan.jr): Change wchar_t* to std::string& and fix callers.
-GURL ChromeFrameHTTPServer::Resolve(const wchar_t* relative_url) {
- return test_server_.GetURL(WideToUTF8(relative_url));
-}
-
-FilePath ChromeFrameHTTPServer::GetDataDir() {
- return test_server_.document_root();
-}
diff --git a/chrome_frame/test/http_server.h b/chrome_frame/test/http_server.h
deleted file mode 100644
index fe88ba9..0000000
--- a/chrome_frame/test/http_server.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2010 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.
-
-#ifndef CHROME_FRAME_TEST_HTTP_SERVER_H_
-#define CHROME_FRAME_TEST_HTTP_SERVER_H_
-
-#include <windows.h>
-#include <string>
-
-#include "googleurl/src/gurl.h"
-#include "base/ref_counted.h"
-#include "net/test/test_server.h"
-
-class FilePath;
-
-// Chrome Frame specilization of http server from net.
-class ChromeFrameHTTPServer {
- public:
- ChromeFrameHTTPServer();
-
- void SetUp();
- void TearDown();
- GURL Resolve(const wchar_t* relative_url);
- FilePath GetDataDir();
-
- net::TestServer* test_server() { return &test_server_; }
-
- protected:
- net::TestServer test_server_;
-};
-
-#endif // CHROME_FRAME_TEST_HTTP_SERVER_H_
diff --git a/chrome_frame/test/test_with_web_server.h b/chrome_frame/test/test_with_web_server.h
index eaecbef..12bce26 100644
--- a/chrome_frame/test/test_with_web_server.h
+++ b/chrome_frame/test/test_with_web_server.h
@@ -14,7 +14,6 @@
#include "base/utf_string_conversions.h"
#include "base/win/scoped_handle.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
-#include "chrome_frame/test/http_server.h"
#include "chrome_frame/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome_frame/test/url_request_test.cc b/chrome_frame/test/url_request_test.cc
index a9b4ec5..874bf64 100644
--- a/chrome_frame/test/url_request_test.cc
+++ b/chrome_frame/test/url_request_test.cc
@@ -1,20 +1,19 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
+
#include <atlbase.h>
#include <atlcom.h>
#include "app/win/scoped_com_initializer.h"
+#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/test_server.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gmock_mutant.h"
-
+#include "chrome_frame/test/test_with_web_server.h"
#include "chrome_frame/urlmon_url_request.h"
#include "chrome_frame/urlmon_url_request_private.h"
-#include "chrome_frame/test/chrome_frame_test_utils.h"
-#include "chrome_frame/test/http_server.h"
-#include "chrome_frame/test/test_with_web_server.h"
+#include "testing/gmock_mutant.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
using testing::CreateFunctor;