summaryrefslogtreecommitdiffstats
path: root/content/worker
diff options
context:
space:
mode:
authoradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 19:11:43 +0000
committeradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 19:11:43 +0000
commitb520d4e30f4987dc7bebc5526a5ba1be3831f92a (patch)
tree635fd249a38e8d58e9e678b965d3d0dc7aa640e8 /content/worker
parentcc7a504ffa92d064c13d4898210e3cc01d13aa0f (diff)
downloadchromium_src-b520d4e30f4987dc7bebc5526a5ba1be3831f92a.zip
chromium_src-b520d4e30f4987dc7bebc5526a5ba1be3831f92a.tar.gz
chromium_src-b520d4e30f4987dc7bebc5526a5ba1be3831f92a.tar.bz2
Run the Worker tests for resolveLocalFileSystemURL that were added
in http://trac.webkit.org/changeset/81640. Includes updates to the testing framework to mirror the way NRWT runs HTTP tests. R=michaeln@chromium.org Review URL: http://codereview.chromium.org/6727001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker')
-rw-r--r--content/worker/worker_uitest.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/content/worker/worker_uitest.cc b/content/worker/worker_uitest.cc
index 56d8c47..0e7c8d9 100644
--- a/content/worker/worker_uitest.cc
+++ b/content/worker/worker_uitest.cc
@@ -713,6 +713,37 @@ class WorkerFileSystemTest : public WorkerTest {
GURL about_url(chrome::kAboutBlankURL);
EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(about_url));
}
+
+ void RunWorkerFileSystemLayoutHttpTests(const char* tests[], int num_tests) {
+ FilePath worker_test_dir = FilePath().AppendASCII("http")
+ .AppendASCII("tests");
+
+ FilePath filesystem_test_dir = FilePath().AppendASCII("filesystem")
+ .AppendASCII("workers");
+ InitializeForLayoutTest(worker_test_dir, filesystem_test_dir, kHttpPort);
+
+ AddResourceForLayoutTest(worker_test_dir.AppendASCII("filesystem"),
+ FilePath().AppendASCII("resources"));
+
+ AddResourceForLayoutTest(worker_test_dir.AppendASCII("filesystem"),
+ FilePath().AppendASCII("script-tests"));
+
+ AddResourceForLayoutTest(worker_test_dir.AppendASCII("filesystem"),
+ FilePath().AppendASCII("workers")
+ .AppendASCII("script-tests"));
+
+ StartHttpServer(new_http_root_dir_);
+ for (int i = 0; i < num_tests; ++i)
+ RunLayoutTest(tests[i], 8000);
+ StopHttpServer();
+
+ // Navigate to a blank page so that any workers are cleaned up.
+ // This helps leaks trackers do a better job of reporting.
+ scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
+ GURL about_url(chrome::kAboutBlankURL);
+ EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(about_url));
+ }
};
TEST_F(WorkerFileSystemTest, Temporary) {
@@ -743,6 +774,14 @@ TEST_F(WorkerFileSystemTest, FileEntryToURISync) {
RunWorkerFileSystemLayoutTest("file-entry-to-uri-sync.html");
}
+TEST_F(WorkerFileSystemTest, ResolveURLHttpTests) {
+ static const char* kLayoutTests[] = {
+ "resolve-url.html",
+ "resolve-url-sync.html"
+ };
+ RunWorkerFileSystemLayoutHttpTests(kLayoutTests, arraysize(kLayoutTests));
+}
+
#if defined(OS_LINUX)
// These tests fail on Linux due to an assert in WebKit's RNG.
// See http://webkit.org/b/55728.