diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 08:01:57 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 08:01:57 +0000 |
commit | 466ee60a295cdd63ee62ab10206eff809e0718ab (patch) | |
tree | 56e0092cc3e1c48e8379eddbb95c6d1b8ac30e6c /chrome/worker | |
parent | 96b9e5ca56317d44713580469fe3f5142810a131 (diff) | |
download | chromium_src-466ee60a295cdd63ee62ab10206eff809e0718ab.zip chromium_src-466ee60a295cdd63ee62ab10206eff809e0718ab.tar.gz chromium_src-466ee60a295cdd63ee62ab10206eff809e0718ab.tar.bz2 |
Add Worker tests for FileSystem API.
Depends on the patch for webkit.org/b/46405
Currently it's disabled as the feature is not turned on by default yet (may need some trick to force enabling it for ui_tests).
BUG=32277
TEST=WorkerTest.WorkerFileSystemLayoutTest
Review URL: http://codereview.chromium.org/3576005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/worker_uitest.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index 29d4723..9ac4fa1 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -151,6 +151,30 @@ class WorkerTest : public UILayoutTest { EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(about_url)); } + void RunWorkerFileSystemLayoutTest(const std::string& test_case_file_name) { + FilePath worker_test_dir; + worker_test_dir = worker_test_dir.AppendASCII("fast"); + + FilePath filesystem_test_dir; + filesystem_test_dir = filesystem_test_dir.AppendASCII("filesystem"); + filesystem_test_dir = filesystem_test_dir.AppendASCII("workers"); + InitializeForLayoutTest(worker_test_dir, filesystem_test_dir, kNoHttpPort); + + FilePath resource_dir; + resource_dir = resource_dir.AppendASCII("resources"); + AddResourceForLayoutTest(worker_test_dir.AppendASCII("filesystem"), + resource_dir); + + RunLayoutTest(test_case_file_name, kNoHttpPort); + + // 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()); + DCHECK(tab.get()); + GURL about_url(chrome::kAboutBlankURL); + EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(about_url)); + } + bool NavigateAndWaitForAuth(TabProxy* tab, const GURL& url) { // Pass a large number of navigations to tell the tab to block until an auth // dialog pops up. @@ -664,3 +688,30 @@ TEST_F(WorkerTest, FLAKY_QueuedSharedWorkerStartedFromOtherTab) { ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); } + +// FileSystem worker tests. +// They are disabled for now as the feature is not enabled by default. +// http://crbug.com/32277 +TEST_F(WorkerTest, DISABLED_WorkerFileSystemTemporaryTest) { + RunWorkerFileSystemLayoutTest("simple-temporary.html"); +} + +TEST_F(WorkerTest, DISABLED_WorkerFileSystemPersistentTest) { + RunWorkerFileSystemLayoutTest("simple-persistent.html"); +} + +TEST_F(WorkerTest, DISABLED_WorkerFileSystemSyncTemporaryTest) { + RunWorkerFileSystemLayoutTest("simple-temporary-sync.html"); +} + +TEST_F(WorkerTest, DISABLED_WorkerFileSystemSyncPersistentTest) { + RunWorkerFileSystemLayoutTest("simple-persistent-sync.html"); +} + +TEST_F(WorkerTest, DISABLED_WorkerFileSystemAsyncOperationsTest) { + RunWorkerFileSystemLayoutTest("async-operations.html"); +} + +TEST_F(WorkerTest, DISABLED_WorkerFileSystemSyncOperationsTest) { + RunWorkerFileSystemLayoutTest("sync-operations.html"); +} |