summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-30 21:49:21 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-30 21:49:21 +0000
commitbaf9e25f103eb1138fcd41d917728faee80e62e2 (patch)
tree8d9b78fc3afb7e9c79570873b2c7d5529d1a02be /chrome/browser/printing
parent1ea316d7174804dd49c43fe4abcb15620b248634 (diff)
downloadchromium_src-baf9e25f103eb1138fcd41d917728faee80e62e2.zip
chromium_src-baf9e25f103eb1138fcd41d917728faee80e62e2.tar.gz
chromium_src-baf9e25f103eb1138fcd41d917728faee80e62e2.tar.bz2
Add FTP unit test in preparation for portable FTP implementation.
Clean up test server code. Originally from issue 12939, written by Ibrar Ahmed (ibrar.ahmed@gmail.com) Review URL: http://codereview.chromium.org/16490 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/printing_layout_uitest.cc33
1 files changed, 22 insertions, 11 deletions
diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc
index a8c5059..086c2b9 100644
--- a/chrome/browser/printing/printing_layout_uitest.cc
+++ b/chrome/browser/printing/printing_layout_uitest.cc
@@ -457,7 +457,8 @@ class DismissTheWindow : public base::RefCountedThreadSafe<DismissTheWindow> {
dialog_window,
WM_COMMAND,
print_button_id,
- reinterpret_cast<LPARAM>(GetDlgItem(dialog_window, print_button_id)));
+ reinterpret_cast<LPARAM>(GetDlgItem(dialog_window,
+ print_button_id)));
// Try again.
if (res)
return;
@@ -498,8 +499,11 @@ TEST_F(PrintingLayoutTextTest, DISABLED_Complex) {
return;
// Print a document, check its output.
- TestServer server(kDocRoot);
- NavigateToURL(server.TestServerPage("files/printing/test1.html"));
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
+
+ NavigateToURL(server->TestServerPage("files/printing/test1.html"));
PrintNowTab();
EXPECT_EQ(0., CompareWithResult(L"test1"));
}
@@ -524,13 +528,16 @@ TEST_F(PrintingLayoutTestHidden, ManyTimes) {
if (IsTestCaseDisabled())
return;
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
+
ASSERT_GT(arraysize(kTestPool), 0u);
for (int i = 0; i < arraysize(kTestPool); ++i) {
if (i)
CleanupDumpDirectory();
const TestPool& test = kTestPool[i % arraysize(kTestPool)];
- NavigateToURL(server.TestServerPageW(test.source));
+ NavigateToURL(server->TestServerPageW(test.source));
PrintNowTab();
EXPECT_EQ(0., CompareWithResult(test.result)) << test.result;
CleanupDumpDirectory();
@@ -554,13 +561,15 @@ TEST_F(PrintingLayoutTest, DISABLED_Delayed) {
if (win_util::GetWinVersion() < win_util::WINVERSION_XP)
return;
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
{
scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
bool is_timeout = true;
- GURL url = server.TestServerPage("files/printing/popup_delayed_print.htm");
+ GURL url = server->TestServerPage("files/printing/popup_delayed_print.htm");
EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
tab_proxy->NavigateToURL(url));
@@ -579,7 +588,7 @@ TEST_F(PrintingLayoutTest, DISABLED_Delayed) {
worker->Stop();
// Force a navigation elsewhere to verify that it's fine with it.
- url = server.TestServerPage("files/printing/test1.html");
+ url = server->TestServerPage("files/printing/test1.html");
EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
tab_proxy->NavigateToURL(url));
}
@@ -594,12 +603,14 @@ TEST_F(PrintingLayoutTest, DISABLED_IFrame) {
if (IsTestCaseDisabled())
return;
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
{
scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
- GURL url = server.TestServerPage("files/printing/iframe.htm");
+ GURL url = server->TestServerPage("files/printing/iframe.htm");
EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
tab_proxy->NavigateToURL(url));
@@ -617,7 +628,7 @@ TEST_F(PrintingLayoutTest, DISABLED_IFrame) {
worker->Stop();
// Force a navigation elsewhere to verify that it's fine with it.
- url = server.TestServerPage("files/printing/test1.html");
+ url = server->TestServerPage("files/printing/test1.html");
EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
tab_proxy->NavigateToURL(url));
}