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 #ifndef CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ | 5 #ifndef CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ |
6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ | 6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/cancelable_callback.h" | 11 #include "base/cancelable_callback.h" |
| 12 #include "base/file_path.h" |
12 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
13 #include "content/public/browser/render_view_host_observer.h" | 14 #include "content/public/browser/render_view_host_observer.h" |
14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
15 | 16 |
16 class SkBitmap; | 17 class SkBitmap; |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 class Shell; | 21 class Shell; |
21 | 22 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 class WebKitTestController : public base::NonThreadSafe, | 65 class WebKitTestController : public base::NonThreadSafe, |
65 public WebContentsObserver { | 66 public WebContentsObserver { |
66 public: | 67 public: |
67 static WebKitTestController* Get(); | 68 static WebKitTestController* Get(); |
68 | 69 |
69 WebKitTestController(); | 70 WebKitTestController(); |
70 virtual ~WebKitTestController(); | 71 virtual ~WebKitTestController(); |
71 | 72 |
72 // True if the controller is ready for testing. | 73 // True if the controller is ready for testing. |
73 bool PrepareForLayoutTest(const GURL& test_url, | 74 bool PrepareForLayoutTest(const GURL& test_url, |
| 75 const FilePath& current_working_directory, |
74 bool enable_pixel_dumping, | 76 bool enable_pixel_dumping, |
75 const std::string& expected_pixel_hash); | 77 const std::string& expected_pixel_hash); |
76 // True if the controller was reset successfully. | 78 // True if the controller was reset successfully. |
77 bool ResetAfterLayoutTest(); | 79 bool ResetAfterLayoutTest(); |
78 | 80 |
79 void RendererUnresponsive(); | 81 void RendererUnresponsive(); |
80 | 82 |
81 WebKitTestResultPrinter* printer() { return printer_.get(); } | 83 WebKitTestResultPrinter* printer() { return printer_.get(); } |
82 void set_printer(WebKitTestResultPrinter* printer) { | 84 void set_printer(WebKitTestResultPrinter* printer) { |
83 printer_.reset(printer); | 85 printer_.reset(printer); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 void TimeoutHandler(); | 122 void TimeoutHandler(); |
121 | 123 |
122 // Message handlers. | 124 // Message handlers. |
123 void OnDidFinishLoad(); | 125 void OnDidFinishLoad(); |
124 void OnImageDump(const std::string& actual_pixel_hash, const SkBitmap& image); | 126 void OnImageDump(const std::string& actual_pixel_hash, const SkBitmap& image); |
125 void OnTextDump(const std::string& dump); | 127 void OnTextDump(const std::string& dump); |
126 void OnPrintMessage(const std::string& message); | 128 void OnPrintMessage(const std::string& message); |
127 | 129 |
128 scoped_ptr<WebKitTestResultPrinter> printer_; | 130 scoped_ptr<WebKitTestResultPrinter> printer_; |
129 | 131 |
| 132 FilePath current_working_directory_; |
| 133 |
130 Shell* main_window_; | 134 Shell* main_window_; |
131 | 135 |
132 bool enable_pixel_dumping_; | 136 bool enable_pixel_dumping_; |
133 std::string expected_pixel_hash_; | 137 std::string expected_pixel_hash_; |
134 | 138 |
135 bool captured_dump_; | 139 bool captured_dump_; |
136 | 140 |
137 bool dump_as_text_; | 141 bool dump_as_text_; |
138 bool dump_child_frames_; | 142 bool dump_child_frames_; |
139 bool is_printing_; | 143 bool is_printing_; |
(...skipping 26 matching lines...) Expand all Loading... |
166 | 170 |
167 void OnNotImplemented(const std::string& object_name, | 171 void OnNotImplemented(const std::string& object_name, |
168 const std::string& method_name); | 172 const std::string& method_name); |
169 | 173 |
170 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunnerHost); | 174 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunnerHost); |
171 }; | 175 }; |
172 | 176 |
173 } // namespace content | 177 } // namespace content |
174 | 178 |
175 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ | 179 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ |
OLD | NEW |