summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 23:49:28 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 23:49:28 +0000
commit22539b631f43d7d38c3de00f05672eb58416af84 (patch)
tree248889ce5ce14d18024509c6d60b6a17705250d1
parent8b3c015b1a1d00552b95d6488684649c1d9b8be7 (diff)
downloadchromium_src-22539b631f43d7d38c3de00f05672eb58416af84.zip
chromium_src-22539b631f43d7d38c3de00f05672eb58416af84.tar.gz
chromium_src-22539b631f43d7d38c3de00f05672eb58416af84.tar.bz2
Break association between TestShellWebView and TestShell before
deleting TestShell. In layout tests where windows were closed from JavaScript code, in some cases our delayed -cleanup: was called before the NSWindow was autoreleased, which later lead to an attempt to repaint, which would dereference the TestShell being deleted. Patched from http://codereview.chromium.org/18738 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8770 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/layout_tests/test_lists/tests_fixable.txt22
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm9
2 files changed, 19 insertions, 12 deletions
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt
index aec9e58..2a40df8 100644
--- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt
+++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt
@@ -1392,18 +1392,18 @@ MAC : LayoutTests/http/tests/multipart/invalid-image-data.html = FAIL
// window.open crashes (some of these are flaky, in that they don't always
// crash, and are noted as such)
-MAC : LayoutTests/http/tests/navigation/target-frame-from-window.html = CRASH TIMEOUT PASS
-MAC : LayoutTests/http/tests/security/frameNavigation/not-opener.html = CRASH PASS TIMEOUT
-MAC : LayoutTests/http/tests/security/frameNavigation/opener.html = CRASH PASS TIMEOUT
-MAC : LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-window-open.html = PASS CRASH TIMEOUT
+MAC : LayoutTests/http/tests/navigation/target-frame-from-window.html = TIMEOUT PASS
+MAC : LayoutTests/http/tests/security/frameNavigation/not-opener.html = PASS TIMEOUT
+MAC : LayoutTests/http/tests/security/frameNavigation/opener.html = PASS TIMEOUT
+MAC : LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-window-open.html = PASS TIMEOUT
MAC : LayoutTests/http/tests/xmlhttprequest/close-window.html = CRASH TIMEOUT
-MAC : LayoutTests/plugins/open-and-close-window-with-plugin.html = CRASH FAIL TIMEOUT
-MAC : LayoutTests/fast/dom/Window/setting-properties-on-closed-window.html = CRASH PASS TIMEOUT
-MAC : LayoutTests/fast/events/open-window-from-another-frame.html = CRASH PASS TIMEOUT
-MAC : LayoutTests/fast/history/history_reload.html = CRASH PASS TIMEOUT
-MAC : LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open.html = CRASH TIMEOUT FAIL
-MAC : LayoutTests/http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html = CRASH PASS TIMEOUT
-MAC : LayoutTests/http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open.html = PASS CRASH TIMEOUT
+MAC : LayoutTests/plugins/open-and-close-window-with-plugin.html = FAIL TIMEOUT
+MAC : LayoutTests/fast/dom/Window/setting-properties-on-closed-window.html = PASS TIMEOUT
+MAC : LayoutTests/fast/events/open-window-from-another-frame.html = PASS TIMEOUT
+MAC : LayoutTests/fast/history/history_reload.html = PASS TIMEOUT
+MAC : LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open.html = TIMEOUT FAIL
+MAC : LayoutTests/http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html = PASS TIMEOUT
+MAC : LayoutTests/http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open.html = PASS TIMEOUT
MAC : LayoutTests/svg/carto.net/scrollbar.svg = CRASH PASS
// no html tags, bad html (unmatched tags)
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index a288abc..4ec9a2c 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -137,8 +137,15 @@ void TestShell::PlatformCleanUp() {
void TestShell::DestroyAssociatedShell(gfx::NativeWindow handle) {
WindowMap::iterator it = window_map_.Get().find(handle);
if (it != window_map_.Get().end()) {
+ // Break the view's association with its shell before deleting the shell.
+ TestShellWebView* web_view =
+ static_cast<TestShellWebView*>(it->second->m_webViewHost->view_handle());
+ if ([web_view isKindOfClass:[TestShellWebView class]]) {
+ [web_view setShell:NULL];
+ }
+
delete it->second;
- window_map_.Get().erase(handle);
+ window_map_.Get().erase(it);
} else {
LOG(ERROR) << "Failed to find shell for window during destroy";
}