summaryrefslogtreecommitdiffstats
path: root/content/worker
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 17:41:07 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 17:41:07 +0000
commitcb456f494ff09efb876af4850fc0ff7fb8f9c6ac (patch)
tree136265f711fe4957df0e30cd7b9b295e5385ac1a /content/worker
parent8286f51aaab9c769e70a1bcad5c568cec6636ba0 (diff)
downloadchromium_src-cb456f494ff09efb876af4850fc0ff7fb8f9c6ac.zip
chromium_src-cb456f494ff09efb876af4850fc0ff7fb8f9c6ac.tar.gz
chromium_src-cb456f494ff09efb876af4850fc0ff7fb8f9c6ac.tar.bz2
GTTF: Clean up UITest::{Start,Stop}HttpServer:
- On Windows, LaunchAppWithHandleInheritance was not needed, just LaunchApp is sufficient - Return values were not checked; I wonder how many of those resulted in mysterious flaky failures - Add a scoper object (LayoutTestHttpServer), to make sure we stop the server even if some other assertions fail. Note: this change may expose failures that were silently ingored before. This is a *good* thing. BUG=none Review URL: http://codereview.chromium.org/7084038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker')
-rw-r--r--content/worker/worker_uitest.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/content/worker/worker_uitest.cc b/content/worker/worker_uitest.cc
index 5b2f4a2..6099a05 100644
--- a/content/worker/worker_uitest.cc
+++ b/content/worker/worker_uitest.cc
@@ -9,6 +9,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
+#include "chrome/test/layout_test_http_server.h"
#include "chrome/test/ui/ui_layout_test.h"
#include "chrome/test/ui_test_utils.h"
#include "content/browser/worker_host/worker_service.h"
@@ -437,10 +438,11 @@ TEST_F(WorkerTest, DISABLED_WorkerHttpLayoutTests) {
worker_test_dir = worker_test_dir.AppendASCII("workers");
InitializeForLayoutTest(http_test_dir, worker_test_dir, kHttpPort);
- StartHttpServer(new_http_root_dir_);
+ LayoutTestHttpServer http_server(new_http_root_dir_, kHttpPort);
+ ASSERT_TRUE(http_server.Start());
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
RunLayoutTest(kLayoutTestFiles[i], kHttpPort);
- StopHttpServer();
+ ASSERT_TRUE(http_server.Stop());
}
TEST_F(WorkerTest, WorkerWebSocketLayoutTests) {
@@ -468,10 +470,11 @@ TEST_F(WorkerTest, WorkerWebSocketLayoutTests) {
ui_test_utils::TestWebSocketServer websocket_server;
ASSERT_TRUE(websocket_server.Start(websocket_root_dir));
- StartHttpServer(new_http_root_dir_);
+ LayoutTestHttpServer http_server(new_http_root_dir_, kHttpPort);
+ ASSERT_TRUE(http_server.Start());
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
RunLayoutTest(kLayoutTestFiles[i], kHttpPort);
- StopHttpServer();
+ ASSERT_TRUE(http_server.Stop());
}
TEST_F(WorkerTest, DISABLED_WorkerXhrHttpLayoutTests) {
@@ -506,10 +509,11 @@ TEST_F(WorkerTest, DISABLED_WorkerXhrHttpLayoutTests) {
worker_test_dir = worker_test_dir.AppendASCII("workers");
InitializeForLayoutTest(http_test_dir, worker_test_dir, kHttpPort);
- StartHttpServer(new_http_root_dir_);
+ LayoutTestHttpServer http_server(new_http_root_dir_, kHttpPort);
+ ASSERT_TRUE(http_server.Start());
for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
RunLayoutTest(kLayoutTestFiles[i], kHttpPort);
- StopHttpServer();
+ ASSERT_TRUE(http_server.Stop());
}
// Flaky, http://crbug.com/34996.
@@ -740,10 +744,11 @@ class WorkerFileSystemTest : public WorkerTest {
FilePath().AppendASCII("workers")
.AppendASCII("script-tests"));
- StartHttpServer(new_http_root_dir_);
+ LayoutTestHttpServer http_server(new_http_root_dir_, 8000);
+ ASSERT_TRUE(http_server.Start());
for (int i = 0; i < num_tests; ++i)
RunLayoutTest(tests[i], 8000);
- StopHttpServer();
+ ASSERT_TRUE(http_server.Stop());
// Navigate to a blank page so that any workers are cleaned up.
// This helps leaks trackers do a better job of reporting.