diff options
-rw-r--r-- | webkit/tools/test_shell/test_shell.h | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 9 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 5 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_win.cc | 5 |
5 files changed, 23 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index bd2a574..f0e7ee0 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -236,6 +236,9 @@ public: static void DestroyAssociatedShell(gfx::WindowHandle handle); #endif + // Show the "attach to me" dialog, for debugging test shell startup. + static void ShowStartupDebuggingDialog(); + protected: bool Initialize(const std::wstring& startingURL); void SizeToSVG(); diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 67d25c1..22d9106 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -512,6 +512,15 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) { return new_url; } +// static +void TestShell::ShowStartupDebuggingDialog() { + GtkWidget* dialog = gtk_message_dialog_new( + NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "attach to me?"); + gtk_window_set_title(GTK_WINDOW(dialog), "test_shell"); + gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop. + gtk_widget_destroy(dialog); +} + //----------------------------------------------------------------------------- namespace webkit_glue { diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index f4a14c9d2..c92262c 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -615,6 +615,11 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) { return new_url; } +// static +void TestShell::ShowStartupDebuggingDialog() { + // TODO(port): Show a modal dialog here with an attach to me message. +} + //----------------------------------------------------------------------------- namespace webkit_glue { diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index f4e5608..9c7ecfe 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -148,10 +148,8 @@ int main(int argc, char* argv[]) { #endif CommandLine parsed_command_line; -#if defined(OS_WIN) if (parsed_command_line.HasSwitch(test_shell::kStartupDialog)) - MessageBox(NULL, L"attach to me?", L"test_shell", MB_OK); -#endif + TestShell::ShowStartupDebuggingDialog(); // Allocate a message loop for this thread. Although it is not used // directly, its constructor sets up some necessary state. diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index 12c2c47..287aca3 100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -640,6 +640,11 @@ void TestShell::DumpRenderTree() { file_path); } +// static +void TestShell::ShowStartupDebuggingDialog() { + MessageBox(NULL, L"attach to me?", L"test_shell", MB_OK); +} + ///////////////////////////////////////////////////////////////////////////// // WebKit glue functions |