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

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

Issue 63091: Prevent test shell editing events from getting to the webview delegate after ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "v8_proxy.h" 5 #include "v8_proxy.h"
6 #undef LOG 6 #undef LOG
7 7
8 #include "webkit/tools/test_shell/test_shell.h" 8 #include "webkit/tools/test_shell/test_shell.h"
9 9
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 TestShell::~TestShell() { 120 TestShell::~TestShell() {
121 // Navigate to an empty page to fire all the destruction logic for the 121 // Navigate to an empty page to fire all the destruction logic for the
122 // current page. 122 // current page.
123 LoadURL(L"about:blank"); 123 LoadURL(L"about:blank");
124 124
125 // Call GC twice to clean up garbage. 125 // Call GC twice to clean up garbage.
126 CallJSGC(); 126 CallJSGC();
127 CallJSGC(); 127 CallJSGC();
128 128
129 webView()->SetDelegate(NULL);
129 PlatformCleanUp(); 130 PlatformCleanUp();
130 131
131 StatsTable *table = StatsTable::current(); 132 StatsTable *table = StatsTable::current();
132 if (dump_stats_table_on_exit_) { 133 if (dump_stats_table_on_exit_) {
133 // Dump the stats table. 134 // Dump the stats table.
134 printf("<stats>\n"); 135 printf("<stats>\n");
135 if (table != NULL) { 136 if (table != NULL) {
136 int counter_max = table->GetMaxCounters(); 137 int counter_max = table->GetMaxCounters();
137 for (int index=0; index < counter_max; index++) { 138 for (int index=0; index < counter_max; index++) {
138 std::string name(table->GetRowName(index)); 139 std::string name(table->GetRowName(index));
(...skipping 13 matching lines...) Expand all
152 bool rv = shell->Initialize(startingURL); 153 bool rv = shell->Initialize(startingURL);
153 if (rv) { 154 if (rv) {
154 if (result) 155 if (result)
155 *result = shell; 156 *result = shell;
156 TestShell::windowList()->push_back(shell->m_mainWnd); 157 TestShell::windowList()->push_back(shell->m_mainWnd);
157 } 158 }
158 return rv; 159 return rv;
159 } 160 }
160 161
161 void TestShell::ShutdownTestShell() { 162 void TestShell::ShutdownTestShell() {
162 PlatformShutdown(); 163 PlatformShutdown();
Evan Martin 2009/04/07 22:07:29 thanks for fixing these, they were driving me craz
Evan Stade 2009/04/07 22:28:24 there's plenty more 4-space tabs where these came
163 SimpleResourceLoaderBridge::Shutdown(); 164 SimpleResourceLoaderBridge::Shutdown();
164 delete window_list_; 165 delete window_list_;
165 delete TestShell::web_prefs_; 166 delete TestShell::web_prefs_;
166 } 167 }
167 168
168 // All fatal log messages (e.g. DCHECK failures) imply unit test failures 169 // All fatal log messages (e.g. DCHECK failures) imply unit test failures
169 static void UnitTestAssertHandler(const std::string& str) { 170 static void UnitTestAssertHandler(const std::string& str) {
170 FAIL() << str; 171 FAIL() << str;
171 } 172 }
172 173
173 // static 174 // static
174 void TestShell::Dump(TestShell* shell) { 175 void TestShell::Dump(TestShell* shell) {
175 const TestParams* params = NULL; 176 const TestParams* params = NULL;
176 if ((shell == NULL) || ((params = shell->test_params()) == NULL)) 177 if ((shell == NULL) || ((params = shell->test_params()) == NULL))
177 return; 178 return;
178 179
179 WebCore::V8Proxy::ProcessConsoleMessages(); 180 WebCore::V8Proxy::ProcessConsoleMessages();
180 // Echo the url in the output so we know we're not getting out of sync. 181 // Echo the url in the output so we know we're not getting out of sync.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 return NULL; 440 return NULL;
440 441
441 return new_win->webView(); 442 return new_win->webView();
442 } 443 }
443 444
444 void TestShell::SizeToSVG() { 445 void TestShell::SizeToSVG() {
445 SizeTo(kSVGTestWindowWidth, kSVGTestWindowHeight); 446 SizeTo(kSVGTestWindowWidth, kSVGTestWindowHeight);
446 } 447 }
447 448
448 void TestShell::SizeToDefault() { 449 void TestShell::SizeToDefault() {
449 SizeTo(kTestWindowWidth, kTestWindowHeight); 450 SizeTo(kTestWindowWidth, kTestWindowHeight);
450 } 451 }
451 452
452 void TestShell::ResetTestController() { 453 void TestShell::ResetTestController() {
453 layout_test_controller_->Reset(); 454 layout_test_controller_->Reset();
454 event_sending_controller_->Reset(); 455 event_sending_controller_->Reset();
455 456
456 // Reset state in the test webview delegate. 457 // Reset state in the test webview delegate.
457 delegate_ = new TestWebViewDelegate(this); 458 delegate_ = new TestWebViewDelegate(this);
458 webView()->SetDelegate(delegate_); 459 webView()->SetDelegate(delegate_);
459 } 460 }
460 461
461 void TestShell::LoadURL(const wchar_t* url) { 462 void TestShell::LoadURL(const wchar_t* url) {
462 LoadURLForFrame(url, NULL); 463 LoadURLForFrame(url, NULL);
463 } 464 }
464 465
465 bool TestShell::Navigate(const TestNavigationEntry& entry, bool reload) { 466 bool TestShell::Navigate(const TestNavigationEntry& entry, bool reload) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 608
608 bool IsDefaultPluginEnabled() { 609 bool IsDefaultPluginEnabled() {
609 return false; 610 return false;
610 } 611 }
611 612
612 std::wstring GetWebKitLocale() { 613 std::wstring GetWebKitLocale() {
613 return L"en-US"; 614 return L"en-US";
614 } 615 }
615 616
616 } // namespace webkit_glue 617 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698