Title: [108225] trunk/Tools
- Revision
- 108225
- Author
- [email protected]
- Date
- 2012-02-20 01:30:24 -0800 (Mon, 20 Feb 2012)
Log Message
[chromium] check that we're not running multiple modal dialogs at the same time
https://bugs.webkit.org/show_bug.cgi?id=78486
Reviewed by Kent Tamura.
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):
* DumpRenderTree/chromium/TestShell.h:
(TestShell::setIsDisplayingModalDialog):
(TestShell::isDisplayingModalDialog):
(TestShell):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::runModal):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (108224 => 108225)
--- trunk/Tools/ChangeLog 2012-02-20 09:16:46 UTC (rev 108224)
+++ trunk/Tools/ChangeLog 2012-02-20 09:30:24 UTC (rev 108225)
@@ -1,3 +1,19 @@
+2012-02-20 Jochen Eisinger <[email protected]>
+
+ [chromium] check that we're not running multiple modal dialogs at the same time
+ https://bugs.webkit.org/show_bug.cgi?id=78486
+
+ Reviewed by Kent Tamura.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::setIsDisplayingModalDialog):
+ (TestShell::isDisplayingModalDialog):
+ (TestShell):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::runModal):
+
2012-02-20 Martin Robinson <[email protected]>
Fix WebKit2GTK+ for 'make distcheck'.
Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (108224 => 108225)
--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp 2012-02-20 09:16:46 UTC (rev 108224)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp 2012-02-20 09:30:24 UTC (rev 108225)
@@ -116,6 +116,7 @@
, m_stressOpt(false)
, m_stressDeopt(false)
, m_dumpWhenFinished(true)
+ , m_isDisplayingModalDialog(false)
{
WebRuntimeFeatures::enableDataTransferItems(true);
WebRuntimeFeatures::enableGeolocation(true);
Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.h (108224 => 108225)
--- trunk/Tools/DumpRenderTree/chromium/TestShell.h 2012-02-20 09:16:46 UTC (rev 108224)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.h 2012-02-20 09:30:24 UTC (rev 108225)
@@ -163,6 +163,9 @@
// testing where we only want to have the output from the last load.
void setDumpWhenFinished(bool dumpWhenFinished) { m_dumpWhenFinished = dumpWhenFinished; }
+ void setIsDisplayingModalDialog(bool isDisplayingModalDialog) { m_isDisplayingModalDialog = isDisplayingModalDialog; }
+ bool isDisplayingModalDialog() const { return m_isDisplayingModalDialog; }
+
WebViewHost* createNewWindow(const WebKit::WebURL&);
void closeWindow(WebViewHost*);
void closeRemainingWindows();
@@ -234,6 +237,7 @@
bool m_stressDeopt;
std::string m_javaScriptFlags;
bool m_dumpWhenFinished;
+ bool m_isDisplayingModalDialog;
// List of all windows in this process.
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (108224 => 108225)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-02-20 09:16:46 UTC (rev 108224)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-02-20 09:30:24 UTC (rev 108225)
@@ -893,11 +893,21 @@
void WebViewHost::runModal()
{
+ if (m_shell->isDisplayingModalDialog()) {
+ // DumpRenderTree doesn't support real modal dialogs, so a test shouldn't try to start two modal dialogs at the same time.
+ ASSERT_NOT_REACHED();
+ return;
+ }
+ // This WebViewHost might get deleted before RunMessageLoop() returns, so keep a copy of the m_shell member variable around.
+ ASSERT(m_shell->webViewHost() != this);
+ TestShell* shell = m_shell;
+ shell->setIsDisplayingModalDialog(true);
bool oldState = webkit_support::MessageLoopNestableTasksAllowed();
webkit_support::MessageLoopSetNestableTasksAllowed(true);
m_inModalLoop = true;
webkit_support::RunMessageLoop();
webkit_support::MessageLoopSetNestableTasksAllowed(oldState);
+ shell->setIsDisplayingModalDialog(false);
}
bool WebViewHost::enterFullScreen()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes