OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/scoped_temp_dir.h" | 6 #include "base/scoped_temp_dir.h" |
7 #include "chrome/test/base/in_process_browser_test.h" | 7 #include "chrome/test/base/in_process_browser_test.h" |
8 | 8 |
9 class LayoutTestHttpServer; | 9 class LayoutTestHttpServer; |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 27 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
28 // Runs a layout test given its filename relative to the path given to the | 28 // Runs a layout test given its filename relative to the path given to the |
29 // constructor. | 29 // constructor. |
30 void RunLayoutTest(const std::string& test_case_file_name); | 30 void RunLayoutTest(const std::string& test_case_file_name); |
31 // Runs a layout test using the HTTP test server. The second constructor must | 31 // Runs a layout test using the HTTP test server. The second constructor must |
32 // have been used. | 32 // have been used. |
33 void RunHttpLayoutTest(const std::string& test_case_file_name); | 33 void RunHttpLayoutTest(const std::string& test_case_file_name); |
34 void AddResourceForLayoutTest(const FilePath& parent_dir, | 34 void AddResourceForLayoutTest(const FilePath& parent_dir, |
35 const FilePath& resource_name); | 35 const FilePath& resource_name); |
36 | 36 |
| 37 void set_wait_until_done(bool value) { wait_until_done_ = value; } |
| 38 |
37 private: | 39 private: |
38 void RunLayoutTestInternal(const std::string& test_case_file_name, | 40 void RunLayoutTestInternal(const std::string& test_case_file_name, |
39 const GURL& url); | 41 const GURL& url); |
40 void WriteModifiedFile(const std::string& test_case_file_name, | 42 void WriteModifiedFile(const std::string& test_case_file_name, |
41 FilePath* test_path); | 43 FilePath* test_path); |
42 | 44 |
43 FilePath our_original_layout_test_dir_; | 45 FilePath our_original_layout_test_dir_; |
44 FilePath test_parent_dir_; | 46 FilePath test_parent_dir_; |
45 FilePath test_case_dir_; | 47 FilePath test_case_dir_; |
46 FilePath our_layout_test_temp_dir_; | 48 FilePath our_layout_test_temp_dir_; |
47 FilePath rebase_result_dir_; | 49 FilePath rebase_result_dir_; |
48 FilePath rebase_result_chromium_dir_; | 50 FilePath rebase_result_chromium_dir_; |
49 FilePath rebase_result_win_dir_; | 51 FilePath rebase_result_win_dir_; |
50 ScopedTempDir scoped_temp_dir_; | 52 ScopedTempDir scoped_temp_dir_; |
51 int port_; // -2 means no port. -1 means random. | 53 int port_; // -2 means no port. -1 means random. |
| 54 // By default, tests will wait until layoutTestController.notifyDone() is |
| 55 // called. |
| 56 bool wait_until_done_; |
52 scoped_ptr<LayoutTestHttpServer> test_http_server_; | 57 scoped_ptr<LayoutTestHttpServer> test_http_server_; |
53 | 58 |
54 DISALLOW_COPY_AND_ASSIGN(InProcessBrowserLayoutTest); | 59 DISALLOW_COPY_AND_ASSIGN(InProcessBrowserLayoutTest); |
55 }; | 60 }; |
OLD | NEW |