diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-29 17:47:14 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-29 17:47:14 +0000 |
commit | 6d0e9ecbcb06eedf6a5937c022eae7f4af673f04 (patch) | |
tree | 15bfde0b2ae50e97dd4264f4ef1db865295b1ca4 /content/test/layout_browsertest.h | |
parent | 6d610bbe20885750ca2e689af59910c592208620 (diff) | |
download | chromium_src-6d0e9ecbcb06eedf6a5937c022eae7f4af673f04.zip chromium_src-6d0e9ecbcb06eedf6a5937c022eae7f4af673f04.tar.gz chromium_src-6d0e9ecbcb06eedf6a5937c022eae7f4af673f04.tar.bz2 |
Rewrite HTML5 workers ui_tests to browser_tests. Compared to ui_tests, browser_tests are faster, less flaky and sharded. They're also portable to content_browsertests once we have it.
A bunch of these tests have bitrotted because they've been disabled for so long, so there are a number of fixes throughout (some were checked into WebKit). I'll keep an eye out on flakiness of the renabled tests and disable if necessary.
I haven't seen any flakiness when running them now dozens of times on my Win/Mac/Linux, so I'm renabling all disabled tests (36!). I'll keep a close eye on the tree and flakiness dashboard afterwards.
BUG=98716,48148,69881,70861,59786,36800,35965,36555,101996,34996,16934,22599
Review URL: https://chromiumcodereview.appspot.com/9802025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/layout_browsertest.h')
-rw-r--r-- | content/test/layout_browsertest.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/content/test/layout_browsertest.h b/content/test/layout_browsertest.h index bfff60b..5f2ed83 100644 --- a/content/test/layout_browsertest.h +++ b/content/test/layout_browsertest.h @@ -6,24 +6,50 @@ #include "base/scoped_temp_dir.h" #include "chrome/test/base/in_process_browser_test.h" +class LayoutTestHttpServer; + class InProcessBrowserLayoutTest : public InProcessBrowserTest { public: - explicit InProcessBrowserLayoutTest(const FilePath relative_layout_test_path); + explicit InProcessBrowserLayoutTest(const FilePath& test_parent_dir, + const FilePath& test_case_dir); + // Used when running HTTP layout tests. Starts the server in the constructor + // and keeps it running through the lifetime of this test. This is done to + // avoid flakiness in restarting the server while the port is still in use. + // If -1 is passed for |port|, a random number will be used. This is + // recommended when possible, in case multiple tests are running at the same + // time. For some tests this isn't possible though, because they use resources + // that hardcode a specific port. + InProcessBrowserLayoutTest(const FilePath& test_parent_dir, + const FilePath& test_case_dir, + int port); virtual ~InProcessBrowserLayoutTest(); virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; + // Runs a layout test given its filename relative to the path given to the + // constructor. void RunLayoutTest(const std::string& test_case_file_name); + // Runs a layout test using the HTTP test server. The second constructor must + // have been used. + void RunHttpLayoutTest(const std::string& test_case_file_name); void AddResourceForLayoutTest(const FilePath& parent_dir, const FilePath& resource_name); private: + void RunLayoutTestInternal(const std::string& test_case_file_name, + const GURL& url); void WriteModifiedFile(const std::string& test_case_file_name, - GURL* test_url); + FilePath* test_path); FilePath our_original_layout_test_dir_; - FilePath original_relative_path_; + FilePath test_parent_dir_; + FilePath test_case_dir_; FilePath our_layout_test_temp_dir_; + FilePath rebase_result_dir_; + FilePath rebase_result_chromium_dir_; + FilePath rebase_result_win_dir_; ScopedTempDir scoped_temp_dir_; + int port_; // -2 means no port. -1 means random. + scoped_ptr<LayoutTestHttpServer> test_http_server_; DISALLOW_COPY_AND_ASSIGN(InProcessBrowserLayoutTest); }; |