diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 18:29:55 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 18:29:55 +0000 |
commit | bb08f1570dd01855b7a4d71ba37b43af5dae4578 (patch) | |
tree | df21b77f7d7e129ecb256738046719fa8c518f92 /chrome/worker | |
parent | bec2c9fbba00e66bf5b13c59d021a0aa4d03427b (diff) | |
download | chromium_src-bb08f1570dd01855b7a4d71ba37b43af5dae4578.zip chromium_src-bb08f1570dd01855b7a4d71ba37b43af5dae4578.tar.gz chromium_src-bb08f1570dd01855b7a4d71ba37b43af5dae4578.tar.bz2 |
Enable layout tests: worker-constructor.html and worker-script-error.html.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/159429
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/worker_uitest.cc | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index fde40d2..06e8c8e 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -55,6 +55,7 @@ class WorkerTest : public UITest { FilePath new_http_root_dir_; FilePath new_layout_test_dir_; FilePath rebase_result_dir_; + FilePath rebase_result_win_dir_; std::string layout_test_controller_; }; @@ -117,17 +118,16 @@ void WorkerTest::InitializeForLayoutTest(const FilePath& test_parent_dir, // If not found, try to use the original copy of WebKit layout tests for // workers. For testing only in local machine only. - // webkit/data/layout_tests/LayoutTests/.../workers + // third_party/LayoutTests/.../workers if (!file_util::DirectoryExists(layout_test_dir_)) { - layout_test_dir_ = src_dir.AppendASCII("webkit"); - layout_test_dir_ = layout_test_dir_.AppendASCII("data"); - layout_test_dir_ = layout_test_dir_.AppendASCII("layout_tests"); + layout_test_dir_ = src_dir.AppendASCII("third_party"); layout_test_dir_ = layout_test_dir_.Append(test_parent_dir); layout_test_dir_ = layout_test_dir_.Append(test_case_dir); ASSERT_TRUE(file_util::DirectoryExists(layout_test_dir_)); } - // Gets the file path to rebased expected result directory for workers. + // Gets the file path to rebased expected result directory for workers for + // current platform. // webkit/data/layout_tests/platform/chromium_***/LayoutTests/.../workers rebase_result_dir_ = src_dir.AppendASCII("webkit"); rebase_result_dir_ = rebase_result_dir_.AppendASCII("data"); @@ -137,6 +137,19 @@ void WorkerTest::InitializeForLayoutTest(const FilePath& test_parent_dir, rebase_result_dir_ = rebase_result_dir_.Append(test_parent_dir); rebase_result_dir_ = rebase_result_dir_.Append(test_case_dir); + // Gets the file path to rebased expected result directory for workers under + // win32 platform. This is used by other non-win32 platform to use the same + // rebased expected results. +#if !defined(OS_WIN) + rebase_result_win_dir_ = src_dir.AppendASCII("webkit"); + rebase_result_win_dir_ = rebase_result_win_dir_.AppendASCII("data"); + rebase_result_win_dir_ = rebase_result_win_dir_.AppendASCII("layout_tests"); + rebase_result_win_dir_ = rebase_result_win_dir_.AppendASCII("platform"); + rebase_result_win_dir_ = rebase_result_win_dir_.AppendASCII("chromium-win"); + rebase_result_win_dir_ = rebase_result_win_dir_.Append(test_parent_dir); + rebase_result_win_dir_ = rebase_result_win_dir_.Append(test_case_dir); +#endif + // Creates the temporary directory. ASSERT_TRUE(file_util::CreateNewTempDirectory( FILE_PATH_LITERAL("chrome_worker_test_"), &temp_test_dir_)); @@ -244,10 +257,15 @@ void WorkerTest::RunLayoutTest(const std::string& test_case_file_name, std::string expected_result_value; if (!ReadExpectedResult(rebase_result_dir_, test_case_file_name, - &expected_result_value)) - ReadExpectedResult(layout_test_dir_, - test_case_file_name, - &expected_result_value); + &expected_result_value)) { + if (rebase_result_win_dir_.empty() || + !ReadExpectedResult(rebase_result_win_dir_, + test_case_file_name, + &expected_result_value)) + ReadExpectedResult(layout_test_dir_, + test_case_file_name, + &expected_result_value); + } ASSERT_TRUE(!expected_result_value.empty()); // Normalizes the expected result. @@ -283,7 +301,7 @@ TEST_F(WorkerTest, WorkerFastLayoutTests) { "stress-js-execution.html", "use-machine-stack.html", "worker-close.html", - //"worker-constructor.html", + "worker-constructor.html", "worker-context-gc.html", "worker-event-listener.html", "worker-gc.html", @@ -291,6 +309,7 @@ TEST_F(WorkerTest, WorkerFastLayoutTests) { "worker-navigator.html", "worker-replace-global-constructor.html", "worker-replace-self.html", + "worker-script-error.html", "worker-terminate.html", "worker-timeout.html" }; |