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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm

Issue 11299234: Merge 168463 - [Mac] Prevent ppapi fullscreen window from dealloc while on stack. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month 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 | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
===================================================================
--- content/browser/renderer_host/render_widget_host_view_mac_unittest.mm (revision 170033)
+++ content/browser/renderer_host/render_widget_host_view_mac_unittest.mm (working copy)
@@ -310,6 +310,35 @@
EXPECT_FALSE([rwhv_mac_->cocoa_view() suppressNextEscapeKeyUp]);
}
+// Test that command accelerators which destroy the fullscreen window
+// don't crash when forwarded via the window's responder machinery.
+TEST_F(RenderWidgetHostViewMacTest, AcceleratorDestroy) {
+ // Use our own RWH since we need to destroy it.
+ MockRenderWidgetHostDelegate delegate;
+ TestBrowserContext browser_context;
+ MockRenderProcessHost* process_host =
+ new MockRenderProcessHost(&browser_context);
+ // Owned by its |cocoa_view()|.
+ RenderWidgetHostImpl* rwh = new RenderWidgetHostImpl(
+ &delegate, process_host, MSG_ROUTING_NONE);
+ RenderWidgetHostViewMac* view = static_cast<RenderWidgetHostViewMac*>(
+ RenderWidgetHostView::CreateViewForWidget(rwh));
+
+ view->InitAsFullscreen(rwhv_mac_);
+
+ WindowedNotificationObserver observer(
+ NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
+ Source<RenderWidgetHost>(rwh));
+
+ // Command-ESC will destroy the view, while the window is still in
+ // |-performKeyEquivalent:|. There are other cases where this can
+ // happen, Command-ESC is the easiest to trigger.
+ [[view->cocoa_view() window] performKeyEquivalent:
+ cocoa_test_event_utils::KeyEventWithKeyCode(
+ 53, 27, NSKeyDown, NSCommandKeyMask)];
+ observer.Wait();
+}
+
TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) {
const string16 kDummyString = UTF8ToUTF16("hogehoge");
const size_t kDummyOffset = 0;
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698