summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 20:53:16 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 20:53:16 +0000
commita961390713572dc42cb7664ea01d085502f7d940 (patch)
tree6a7103914c3d89a52f59f4151ee32db1e6dc06e8
parente461fedc54f4bc57b430b7e7ec6b59ef0b799e4a (diff)
downloadchromium_src-a961390713572dc42cb7664ea01d085502f7d940.zip
chromium_src-a961390713572dc42cb7664ea01d085502f7d940.tar.gz
chromium_src-a961390713572dc42cb7664ea01d085502f7d940.tar.bz2
Show JavaScript alerts. Useful for testing nested message loops.
Review URL: http://codereview.chromium.org/10651 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5291 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_gtk.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
index e934fd2c..24f16cf 100644
--- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
@@ -41,7 +41,13 @@ WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
}
void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) {
- NOTIMPLEMENTED();
+ // TODO(port): remove GTK_WINDOW bit after gfx::WindowHandle is fixed.
+ GtkWidget* dialog = gtk_message_dialog_new(
+ GTK_WINDOW(shell_->mainWnd()), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK, "%s", WideToUTF8(message).c_str());
+ gtk_window_set_title(GTK_DIALOG(dialog), "JavaScript Alert");
+ gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop.
+ gtk_widget_destroy(dialog);
}
void TestWebViewDelegate::Show(WebWidget* webview,