Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: webkit/tools/test_shell/test_shell.h

Issue 149620: Use WebWidget from the WebKit API. This change also makes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/plugin_tests.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 static bool layout_test_mode() { return layout_test_mode_; } 86 static bool layout_test_mode() { return layout_test_mode_; }
87 87
88 // Called from the destructor to let each platform do any necessary 88 // Called from the destructor to let each platform do any necessary
89 // cleanup. 89 // cleanup.
90 void PlatformCleanUp(); 90 void PlatformCleanUp();
91 91
92 WebView* webView() { 92 WebView* webView() {
93 return m_webViewHost.get() ? m_webViewHost->webview() : NULL; 93 return m_webViewHost.get() ? m_webViewHost->webview() : NULL;
94 } 94 }
95 WebViewHost* webViewHost() { return m_webViewHost.get(); } 95 WebViewHost* webViewHost() { return m_webViewHost.get(); }
96 WebWidget* popup() { return m_popupHost ? m_popupHost->webwidget() : NULL; } 96 WebKit::WebWidget* popup() {
97 return m_popupHost ? m_popupHost->webwidget() : NULL;
98 }
97 WebWidgetHost* popupHost() { return m_popupHost; } 99 WebWidgetHost* popupHost() { return m_popupHost; }
98 100
99 // Called by the LayoutTestController to signal test completion. 101 // Called by the LayoutTestController to signal test completion.
100 void TestFinished(); 102 void TestFinished();
101 103
102 // Called to block the calling thread until TestFinished is called. 104 // Called to block the calling thread until TestFinished is called.
103 void WaitTestFinished(); 105 void WaitTestFinished();
104 106
105 void Show(WebView* webview, WindowOpenDisposition disposition); 107 void Show(WebKit::WebNavigationPolicy policy);
106 108
107 // We use this to avoid relying on Windows focus during layout test mode. 109 // We use this to avoid relying on Windows focus during layout test mode.
108 void SetFocus(WebWidgetHost* host, bool enable); 110 void SetFocus(WebWidgetHost* host, bool enable);
109 111
110 LayoutTestController* layout_test_controller() { 112 LayoutTestController* layout_test_controller() {
111 return layout_test_controller_.get(); 113 return layout_test_controller_.get();
112 } 114 }
113 TestWebViewDelegate* delegate() { return delegate_.get(); } 115 TestWebViewDelegate* delegate() { return delegate_.get(); }
116 TestWebViewDelegate* popup_delegate() { return popup_delegate_.get(); }
114 TestNavigationController* navigation_controller() { 117 TestNavigationController* navigation_controller() {
115 return navigation_controller_.get(); 118 return navigation_controller_.get();
116 } 119 }
117 120
118 // Resets the LayoutTestController and EventSendingController. Should be 121 // Resets the LayoutTestController and EventSendingController. Should be
119 // called before loading a page, since some end-editing event notifications 122 // called before loading a page, since some end-editing event notifications
120 // may arrive after the previous page has finished dumping its text and 123 // may arrive after the previous page has finished dumping its text and
121 // therefore end up in the next test's results if the messages are still 124 // therefore end up in the next test's results if the messages are still
122 // enabled. 125 // enabled.
123 void ResetTestController(); 126 void ResetTestController();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 171
169 static void DestroyWindow(gfx::NativeWindow windowHandle); 172 static void DestroyWindow(gfx::NativeWindow windowHandle);
170 173
171 // Remove the given window from window_list_, return true if it was in the 174 // Remove the given window from window_list_, return true if it was in the
172 // list and was removed and false otherwise. 175 // list and was removed and false otherwise.
173 static bool RemoveWindowFromList(gfx::NativeWindow window); 176 static bool RemoveWindowFromList(gfx::NativeWindow window);
174 177
175 // Implements CreateWebView for TestWebViewDelegate, which in turn 178 // Implements CreateWebView for TestWebViewDelegate, which in turn
176 // is called as a WebViewDelegate. 179 // is called as a WebViewDelegate.
177 WebView* CreateWebView(WebView* webview); 180 WebView* CreateWebView(WebView* webview);
178 WebWidget* CreatePopupWidget(WebView* webview); 181 WebKit::WebWidget* CreatePopupWidget(WebView* webview);
179 void ClosePopup(); 182 void ClosePopup();
180 183
181 #if defined(OS_WIN) 184 #if defined(OS_WIN)
182 static ATOM RegisterWindowClass(); 185 static ATOM RegisterWindowClass();
183 #endif 186 #endif
184 187
185 // Called by the WebView delegate WindowObjectCleared() method, this 188 // Called by the WebView delegate WindowObjectCleared() method, this
186 // binds the layout_test_controller_ and other C++ controller classes to 189 // binds the layout_test_controller_ and other C++ controller classes to
187 // window JavaScript objects so they can be accessed by layout tests. 190 // window JavaScript objects so they can be accessed by layout tests.
188 virtual void BindJSObjectsToWindow(WebFrame* frame); 191 virtual void BindJSObjectsToWindow(WebFrame* frame);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 318
316 scoped_ptr<LayoutTestController> layout_test_controller_; 319 scoped_ptr<LayoutTestController> layout_test_controller_;
317 320
318 scoped_ptr<EventSendingController> event_sending_controller_; 321 scoped_ptr<EventSendingController> event_sending_controller_;
319 322
320 scoped_ptr<TextInputController> text_input_controller_; 323 scoped_ptr<TextInputController> text_input_controller_;
321 324
322 scoped_ptr<TestNavigationController> navigation_controller_; 325 scoped_ptr<TestNavigationController> navigation_controller_;
323 326
324 scoped_refptr<TestWebViewDelegate> delegate_; 327 scoped_refptr<TestWebViewDelegate> delegate_;
328 scoped_refptr<TestWebViewDelegate> popup_delegate_;
325 329
326 const TestParams* test_params_; 330 const TestParams* test_params_;
327 331
328 // True while a test is preparing to run 332 // True while a test is preparing to run
329 bool test_is_preparing_; 333 bool test_is_preparing_;
330 334
331 // True while a test is running 335 // True while a test is running
332 bool test_is_pending_; 336 bool test_is_pending_;
333 337
334 // True if driven from a nested message loop. 338 // True if driven from a nested message loop.
335 bool is_modal_; 339 bool is_modal_;
336 340
337 // The preferences for the test shell. 341 // The preferences for the test shell.
338 static WebPreferences* web_prefs_; 342 static WebPreferences* web_prefs_;
339 343
340 #if defined(OS_WIN) 344 #if defined(OS_WIN)
341 // Used by the watchdog to know when it's finished. 345 // Used by the watchdog to know when it's finished.
342 HANDLE finished_event_; 346 HANDLE finished_event_;
343 #endif 347 #endif
344 348
345 // Dump the stats table counters on exit. 349 // Dump the stats table counters on exit.
346 bool dump_stats_table_on_exit_; 350 bool dump_stats_table_on_exit_;
347 }; 351 };
348 352
349 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_H_ 353 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_H_
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/plugin_tests.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698