OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 layout_test_controller_->ShouldDumpResourceLoadCallbacks(); | 140 layout_test_controller_->ShouldDumpResourceLoadCallbacks(); |
141 } | 141 } |
142 bool ShouldDumpTitleChanges() { | 142 bool ShouldDumpTitleChanges() { |
143 return layout_test_mode_ && | 143 return layout_test_mode_ && |
144 layout_test_controller_->ShouldDumpTitleChanges(); | 144 layout_test_controller_->ShouldDumpTitleChanges(); |
145 } | 145 } |
146 bool AcceptsEditing() { | 146 bool AcceptsEditing() { |
147 return layout_test_controller_->AcceptsEditing(); | 147 return layout_test_controller_->AcceptsEditing(); |
148 } | 148 } |
149 | 149 |
150 void LoadURL(const wchar_t* url); | 150 void LoadFile(const FilePath& file); |
151 void LoadURLForFrame(const wchar_t* url, const wchar_t* frame_name); | 151 void LoadURL(const GURL& url); |
| 152 void LoadURLForFrame(const GURL& url, const std::wstring& frame_name); |
152 void GoBackOrForward(int offset); | 153 void GoBackOrForward(int offset); |
153 void Reload(); | 154 void Reload(); |
154 bool Navigate(const TestNavigationEntry& entry, bool reload); | 155 bool Navigate(const TestNavigationEntry& entry, bool reload); |
155 | 156 |
156 bool PromptForSaveFile(const wchar_t* prompt_title, std::wstring* result); | 157 bool PromptForSaveFile(const wchar_t* prompt_title, std::wstring* result); |
157 std::wstring GetDocumentText(); | 158 std::wstring GetDocumentText(); |
158 void DumpDocumentText(); | 159 void DumpDocumentText(); |
159 void DumpRenderTree(); | 160 void DumpRenderTree(); |
160 | 161 |
161 gfx::NativeWindow mainWnd() const { return m_mainWnd; } | 162 gfx::NativeWindow mainWnd() const { return m_mainWnd; } |
162 gfx::NativeView webViewWnd() const { return m_webViewHost->view_handle(); } | 163 gfx::NativeView webViewWnd() const { return m_webViewHost->view_handle(); } |
163 gfx::NativeEditView editWnd() const { return m_editWnd; } | 164 gfx::NativeEditView editWnd() const { return m_editWnd; } |
164 gfx::NativeView popupWnd() const { return m_popupHost->view_handle(); } | 165 gfx::NativeView popupWnd() const { return m_popupHost->view_handle(); } |
165 | 166 |
166 static WindowList* windowList() { return window_list_; } | 167 static WindowList* windowList() { return window_list_; } |
167 | 168 |
168 // If shell is non-null, then *shell is assigned upon successful return | 169 // If shell is non-null, then *shell is assigned upon successful return |
169 static bool CreateNewWindow(const std::wstring& startingURL, | 170 static bool CreateNewWindow(const GURL& starting_url, |
170 TestShell** shell = NULL); | 171 TestShell** shell = NULL); |
171 | 172 |
172 static void DestroyWindow(gfx::NativeWindow windowHandle); | 173 static void DestroyWindow(gfx::NativeWindow windowHandle); |
173 | 174 |
174 // Remove the given window from window_list_, return true if it was in the | 175 // Remove the given window from window_list_, return true if it was in the |
175 // list and was removed and false otherwise. | 176 // list and was removed and false otherwise. |
176 static bool RemoveWindowFromList(gfx::NativeWindow window); | 177 static bool RemoveWindowFromList(gfx::NativeWindow window); |
177 | 178 |
178 // Implements CreateWebView for TestWebViewDelegate, which in turn | 179 // Implements CreateWebView for TestWebViewDelegate, which in turn |
179 // is called as a WebViewDelegate. | 180 // is called as a WebViewDelegate. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 static void DestroyAssociatedShell(gfx::NativeWindow handle); | 264 static void DestroyAssociatedShell(gfx::NativeWindow handle); |
264 #endif | 265 #endif |
265 | 266 |
266 // Show the "attach to me" dialog, for debugging test shell startup. | 267 // Show the "attach to me" dialog, for debugging test shell startup. |
267 static void ShowStartupDebuggingDialog(); | 268 static void ShowStartupDebuggingDialog(); |
268 | 269 |
269 // This is called indirectly by the network layer to access resources. | 270 // This is called indirectly by the network layer to access resources. |
270 static StringPiece NetResourceProvider(int key); | 271 static StringPiece NetResourceProvider(int key); |
271 | 272 |
272 protected: | 273 protected: |
273 bool Initialize(const std::wstring& startingURL); | 274 bool Initialize(const GURL& starting_url); |
| 275 bool IsSVGTestURL(const GURL& url); |
274 void SizeToSVG(); | 276 void SizeToSVG(); |
275 void SizeToDefault(); | 277 void SizeToDefault(); |
276 void SizeTo(int width, int height); | 278 void SizeTo(int width, int height); |
277 void ResizeSubViews(); | 279 void ResizeSubViews(); |
278 | 280 |
279 // Set the focus in interactive mode (pass through to relevant system call). | 281 // Set the focus in interactive mode (pass through to relevant system call). |
280 void InteractiveSetFocus(WebWidgetHost* host, bool enable); | 282 void InteractiveSetFocus(WebWidgetHost* host, bool enable); |
281 | 283 |
282 #if defined(OS_WIN) | 284 #if defined(OS_WIN) |
283 static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); | 285 static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 #if defined(OS_WIN) | 346 #if defined(OS_WIN) |
345 // Used by the watchdog to know when it's finished. | 347 // Used by the watchdog to know when it's finished. |
346 HANDLE finished_event_; | 348 HANDLE finished_event_; |
347 #endif | 349 #endif |
348 | 350 |
349 // Dump the stats table counters on exit. | 351 // Dump the stats table counters on exit. |
350 bool dump_stats_table_on_exit_; | 352 bool dump_stats_table_on_exit_; |
351 }; | 353 }; |
352 | 354 |
353 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_H_ | 355 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_H_ |
OLD | NEW |