summaryrefslogtreecommitdiffstats
path: root/chrome/worker
diff options
context:
space:
mode:
authordimich@google.com <dimich@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 23:40:08 +0000
committerdimich@google.com <dimich@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 23:40:08 +0000
commita843a3fde6e142db763e90030cbbeac0ebe0dac1 (patch)
tree7a3454ea3b4fe2532ec97759ce0cbf7939e4b638 /chrome/worker
parent2196f3055c77317fddabdcd0c263d037ab6e0699 (diff)
downloadchromium_src-a843a3fde6e142db763e90030cbbeac0ebe0dac1.zip
chromium_src-a843a3fde6e142db763e90030cbbeac0ebe0dac1.tar.gz
chromium_src-a843a3fde6e142db763e90030cbbeac0ebe0dac1.tar.bz2
Add ability to start/stop http server to ui_tests. This will be used to run Workers+XHR layout tests which is impossible to run in test_shell.
BUG=none TEST=none Review URL: http://codereview.chromium.org/125283 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r--chrome/worker/worker_uitest.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc
index f3bfaf3..a49663f 100644
--- a/chrome/worker/worker_uitest.cc
+++ b/chrome/worker/worker_uitest.cc
@@ -39,6 +39,7 @@ class WorkerTest : public UITest {
void InitializeForLayoutTest(const FilePath& test_case_dir);
void RunLayoutTest(const std::string& test_case_file_name);
+ void RunHttpTest(const std::string& test_case_name);
private:
bool ReadExpectedResult(const FilePath& result_dir_path,
@@ -75,6 +76,19 @@ void WorkerTest::RunTest(const std::wstring& test_case) {
ASSERT_STREQ(kTestCompleteSuccess, value.c_str());
}
+void WorkerTest::RunHttpTest(const std::string& test_case_name) {
+ scoped_refptr<TabProxy> tab(GetActiveTab());
+
+ std::string test_url_string(std::string("http://localhost:8080/") +
+ test_case_name);
+ GURL url(test_url_string);
+ ASSERT_TRUE(tab->NavigateToURL(url));
+
+ std::string value = WaitUntilCookieNonEmpty(tab.get(), url,
+ kTestCompleteCookie, kTestIntervalMs, kTestWaitTimeoutMs);
+ ASSERT_STREQ(kTestCompleteSuccess, value.c_str());
+}
+
void WorkerTest::InitializeForLayoutTest(const FilePath& test_case_dir) {
FilePath src_dir;
PathService::Get(base::DIR_SOURCE_ROOT, &src_dir);
@@ -277,3 +291,11 @@ TEST_F(WorkerTest, LimitTotal) {
UITest::GetBrowserProcessCount());
}
+TEST_F(WorkerTest, TestHttpServer) {
+ FilePath path;
+ PathService::Get(chrome::DIR_TEST_DATA, &path);
+ path = path.AppendASCII("workers");
+ StartHttpServer(path);
+ RunHttpTest("test_http_server_up.html");
+ StopHttpServer();
+}