diff options
-rw-r--r-- | DEPS | 3 | ||||
-rw-r--r-- | chrome/test/automation/proxy_launcher.cc | 5 | ||||
-rw-r--r-- | chrome/test/ui/ui_layout_test.cc | 2 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 9 | ||||
-rw-r--r-- | content/worker/worker_uitest.cc | 39 |
5 files changed, 56 insertions, 2 deletions
@@ -172,6 +172,9 @@ deps = { "src/chrome/test/data/layout_tests/LayoutTests/fast/filesystem/resources": Var("webkit_trunk") + "/LayoutTests/fast/filesystem/resources@" + Var("webkit_revision"), + "src/chrome/test/data/layout_tests/LayoutTests/http/tests/filesystem": + Var("webkit_trunk") + "/LayoutTests/http/tests/filesystem@" + + Var("webkit_revision"), "src/third_party/swig/Lib": "/trunk/deps/third_party/swig/Lib@" + Var("swig_revision"), diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index baeff496..90a62b2 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -419,6 +419,9 @@ void ProxyLauncher::PrepareTestCommandline(CommandLine* command_line, // Allow file:// access on ChromeOS. command_line->AppendSwitch(switches::kAllowFileAccess); + + // Allow testing File API over http. + command_line->AppendSwitch(switches::kUnlimitedQuotaForFiles); } bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state, bool wait, diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc index 222358b..1322276 100644 --- a/chrome/test/ui/ui_layout_test.cc +++ b/chrome/test/ui/ui_layout_test.cc @@ -212,7 +212,7 @@ void UILayoutTest::RunLayoutTest(const std::string& test_case_file_name, scoped_ptr<GURL> new_test_url; if (port != kNoHttpPort) new_test_url.reset(new GURL( - StringPrintf("http://localhost:%d/", port) + + StringPrintf("http://127.0.0.1:%d/", port) + url_path + "/" + test_case_file_name)); else new_test_url.reset(new GURL(net::FilePathToFileURL(new_test_file_path))); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 98e6bec..6c10ea1 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -560,6 +560,15 @@ void UITest::StartHttpServerWithPort(const FilePath& root_directory, cmd_line->AppendSwitch("register_cygwin"); cmd_line->AppendSwitchPath("root", root_directory); + FilePath layout_tests_dir; + PathService::Get(base::DIR_SOURCE_ROOT, &layout_tests_dir); + layout_tests_dir = layout_tests_dir.AppendASCII("chrome") + .AppendASCII("test") + .AppendASCII("data") + .AppendASCII("layout_tests") + .AppendASCII("LayoutTests"); + cmd_line->AppendSwitchPath("layout_tests_dir", layout_tests_dir); + // For Windows 7, if we start the lighttpd server on the foreground mode, // it will mess up with the command window and cause conhost.exe to crash. To // work around this, we start the http server on the background mode. 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. |