OLD | NEW |
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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug_on_start.h" | 8 #include "base/debug_on_start.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 text_input_controller_.reset(new TextInputController(this)); | 117 text_input_controller_.reset(new TextInputController(this)); |
118 navigation_controller_.reset(new TestNavigationController(this)); | 118 navigation_controller_.reset(new TestNavigationController(this)); |
119 | 119 |
120 URLRequestFilter* filter = URLRequestFilter::GetInstance(); | 120 URLRequestFilter* filter = URLRequestFilter::GetInstance(); |
121 filter->AddHostnameHandler("test-shell-resource", "inspector", | 121 filter->AddHostnameHandler("test-shell-resource", "inspector", |
122 &URLRequestTestShellFileJob::InspectorFactory); | 122 &URLRequestTestShellFileJob::InspectorFactory); |
123 url_util::AddStandardScheme("test-shell-resource"); | 123 url_util::AddStandardScheme("test-shell-resource"); |
124 } | 124 } |
125 | 125 |
126 TestShell::~TestShell() { | 126 TestShell::~TestShell() { |
127 // Call GC twice to clean up garbage. | 127 // Navigate to an empty page to fire all the destruction logic for the |
128 CallJSGC(); | 128 // current page. |
129 CallJSGC(); | 129 LoadURL(L"about:blank"); |
130 | 130 |
131 PlatformCleanUp(); | 131 // Call GC twice to clean up garbage. |
| 132 CallJSGC(); |
| 133 CallJSGC(); |
132 | 134 |
133 StatsTable *table = StatsTable::current(); | 135 PlatformCleanUp(); |
134 if (dump_stats_table_on_exit_) { | 136 |
135 // Dump the stats table. | 137 StatsTable *table = StatsTable::current(); |
136 printf("<stats>\n"); | 138 if (dump_stats_table_on_exit_) { |
137 if (table != NULL) { | 139 // Dump the stats table. |
138 int counter_max = table->GetMaxCounters(); | 140 printf("<stats>\n"); |
139 for (int index=0; index < counter_max; index++) { | 141 if (table != NULL) { |
140 std::string name(table->GetRowName(index)); | 142 int counter_max = table->GetMaxCounters(); |
141 if (name.length() > 0) { | 143 for (int index=0; index < counter_max; index++) { |
142 int value = table->GetRowValue(index); | 144 std::string name(table->GetRowName(index)); |
143 printf("%s:\t%d\n", name.c_str(), value); | 145 if (name.length() > 0) { |
144 } | 146 int value = table->GetRowValue(index); |
145 } | 147 printf("%s:\t%d\n", name.c_str(), value); |
| 148 } |
146 } | 149 } |
147 printf("</stats>\n"); | |
148 } | 150 } |
| 151 printf("</stats>\n"); |
| 152 } |
149 } | 153 } |
150 | 154 |
151 void TestShell::ShutdownTestShell() { | 155 void TestShell::ShutdownTestShell() { |
152 #if defined(OS_WIN) || defined(OS_MACOSX) | 156 #if defined(OS_WIN) || defined(OS_MACOSX) |
153 PlatformShutdown(); | 157 PlatformShutdown(); |
154 #endif | 158 #endif |
155 SimpleResourceLoaderBridge::Shutdown(); | 159 SimpleResourceLoaderBridge::Shutdown(); |
156 delete window_list_; | 160 delete window_list_; |
157 delete TestShell::web_prefs_; | 161 delete TestShell::web_prefs_; |
158 } | 162 } |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 554 |
551 bool IsDefaultPluginEnabled() { | 555 bool IsDefaultPluginEnabled() { |
552 return false; | 556 return false; |
553 } | 557 } |
554 | 558 |
555 std::wstring GetWebKitLocale() { | 559 std::wstring GetWebKitLocale() { |
556 return L"en-US"; | 560 return L"en-US"; |
557 } | 561 } |
558 | 562 |
559 } // namespace webkit_glue | 563 } // namespace webkit_glue |
OLD | NEW |