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

Unified Diff: webkit/tools/test_shell/test_shell.cc

Issue 13214: Handle destruction of test shell properly. (Closed)
Patch Set: Created 12 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell.cc
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index d132a7f71126a03bd7c29f87929a467cdffcd420..76792650e6969a88b860957c43bcbd9193b23140 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -124,28 +124,32 @@ TestShell::TestShell()
}
TestShell::~TestShell() {
- // Call GC twice to clean up garbage.
- CallJSGC();
- CallJSGC();
-
- PlatformCleanUp();
-
- StatsTable *table = StatsTable::current();
- if (dump_stats_table_on_exit_) {
- // Dump the stats table.
- printf("<stats>\n");
- if (table != NULL) {
- int counter_max = table->GetMaxCounters();
- for (int index=0; index < counter_max; index++) {
- std::string name(table->GetRowName(index));
- if (name.length() > 0) {
- int value = table->GetRowValue(index);
- printf("%s:\t%d\n", name.c_str(), value);
- }
- }
+ // Navigate to an empty page to fire all the destruction logic for the
+ // current page.
+ LoadURL(L"about:blank");
+
+ // Call GC twice to clean up garbage.
+ CallJSGC();
+ CallJSGC();
+
+ PlatformCleanUp();
+
+ StatsTable *table = StatsTable::current();
+ if (dump_stats_table_on_exit_) {
+ // Dump the stats table.
+ printf("<stats>\n");
+ if (table != NULL) {
+ int counter_max = table->GetMaxCounters();
+ for (int index=0; index < counter_max; index++) {
+ std::string name(table->GetRowName(index));
+ if (name.length() > 0) {
+ int value = table->GetRowValue(index);
+ printf("%s:\t%d\n", name.c_str(), value);
+ }
}
- printf("</stats>\n");
}
+ printf("</stats>\n");
+ }
}
void TestShell::ShutdownTestShell() {
« no previous file with comments | « no previous file | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698