diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 21:32:26 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 21:32:26 +0000 |
commit | 2e18d74b76c4b03a92ee008b6a5e5caaf6139224 (patch) | |
tree | 06558d4dd61e080628f8a8333c2a4bac922d3bba /content | |
parent | 7825931bdacb66eb2f41031e48484cd29dc02843 (diff) | |
download | chromium_src-2e18d74b76c4b03a92ee008b6a5e5caaf6139224.zip chromium_src-2e18d74b76c4b03a92ee008b6a5e5caaf6139224.tar.gz chromium_src-2e18d74b76c4b03a92ee008b6a5e5caaf6139224.tar.bz2 |
Convert AppCache's UI test to a browser_test. browser_tests are sharded and run quicker, and are generally less flaky than ui tests. They'll also be portable to content_browsertest once we have it.
I've left these tests as disabled because some of them hang (even under ui_tests).
BUG=90448
Review URL: https://chromiumcodereview.appspot.com/9959024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/appcache/appcache_browsertest.cc (renamed from content/browser/appcache/appcache_ui_test.cc) | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/content/browser/appcache/appcache_ui_test.cc b/content/browser/appcache/appcache_browsertest.cc index 84dfbb3..cff8223 100644 --- a/content/browser/appcache/appcache_ui_test.cc +++ b/content/browser/appcache/appcache_browsertest.cc @@ -2,35 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/file_path.h" -#include "chrome/test/base/layout_test_http_server.h" -#include "chrome/test/ui/ui_layout_test.h" +#include "content/test/layout_browsertest.h" -class AppCacheUITest : public UILayoutTest { +class AppCacheLayoutTest : public InProcessBrowserLayoutTest { public: - void RunAppCacheTests(const char* tests[], int num_tests) { - FilePath http_test_dir; - http_test_dir = http_test_dir.AppendASCII("http"); - http_test_dir = http_test_dir.AppendASCII("tests"); - - FilePath appcache_test_dir; - appcache_test_dir = appcache_test_dir.AppendASCII("appcache"); - InitializeForLayoutTest(http_test_dir, appcache_test_dir, kHttpPort); - - LayoutTestHttpServer http_server(new_http_root_dir_, kHttpPort); - ASSERT_TRUE(http_server.Start()); - for (int i = 0; i < num_tests; ++i) - RunLayoutTest(tests[i], kHttpPort); - ASSERT_TRUE(http_server.Stop()); + AppCacheLayoutTest() : InProcessBrowserLayoutTest( + FilePath().AppendASCII("http").AppendASCII("tests"), + FilePath().AppendASCII("appcache"), + -1) { } protected: - virtual ~AppCacheUITest() {} + virtual ~AppCacheLayoutTest() {} }; // Flaky and slow, hence disabled: http://crbug.com/54717 // The tests that don't depend on PHP should be less flaky. -TEST_F(AppCacheUITest, DISABLED_AppCacheLayoutTests_NoPHP) { +IN_PROC_BROWSER_TEST_F(AppCacheLayoutTest, DISABLED_NoPHP) { static const char* kNoPHPTests[] = { "404-manifest.html", "404-resource.html", @@ -66,12 +54,13 @@ TEST_F(AppCacheUITest, DISABLED_AppCacheLayoutTests_NoPHP) { // https://bugs.webkit.org/show_bug.cgi?id=49104 // "foreign-fallback.html" - RunAppCacheTests(kNoPHPTests, arraysize(kNoPHPTests)); + for (size_t i = 0; i < arraysize(kNoPHPTests); ++i) + RunHttpLayoutTest(kNoPHPTests[i]); } // Flaky: http://crbug.com/54717 // Lighty/PHP is not reliable enough on windows. -TEST_F(AppCacheUITest, DISABLED_AppCacheLayoutTests_PHP) { +IN_PROC_BROWSER_TEST_F(AppCacheLayoutTest, DISABLED_PHP) { static const char* kPHPTests[] = { "auth.html", "fallback.html", @@ -103,5 +92,6 @@ TEST_F(AppCacheUITest, DISABLED_AppCacheLayoutTests_PHP) { // "local-content.html", // "max-size.html", we use a different quota scheme - RunAppCacheTests(kPHPTests, arraysize(kPHPTests)); + for (size_t i = 0; i < arraysize(kPHPTests); ++i) + RunHttpLayoutTest(kPHPTests[i]); } |