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

Unified Diff: ui/app_list/cocoa/apps_search_results_controller.mm

Issue 599803002: Mac: Deflake AppListServiceInteractiveTest.SwitchAppListProfilesDuringSearch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20140923-AppList-OnShutdown
Patch Set: rebase to master Created 6 years, 3 months 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 | « chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/cocoa/apps_search_results_controller.mm
diff --git a/ui/app_list/cocoa/apps_search_results_controller.mm b/ui/app_list/cocoa/apps_search_results_controller.mm
index 314f079e8ad0811830c9949ef6eb68725f989939..4ef61672dae74914f3001c5a0cb8f24cac2a0f64 100644
--- a/ui/app_list/cocoa/apps_search_results_controller.mm
+++ b/ui/app_list/cocoa/apps_search_results_controller.mm
@@ -6,6 +6,7 @@
#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
+#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "skia/ext/skia_utils_mac.h"
#include "ui/app_list/app_list_constants.h"
@@ -401,6 +402,15 @@ const NSBackgroundStyle kBackgroundHovered = NSBackgroundStyleRaised;
[self delegate]);
}
+- (BOOL)canDraw {
+ // AppKit doesn't call -[NSView canDrawConcurrently] which would have told it
+ // that this is unsafe. Returning true from canDraw only if there is a message
+ // loop ensures that no drawing occurs on a background thread. Without this,
+ // ImageSkia can assert when trying to get bitmaps. http://crbug.com/417148.
+ // This means unit tests will always return 'NO', but that's OK.
+ return !!base::MessageLoop::current() && [super canDraw];
+}
+
- (void)mouseDown:(NSEvent*)theEvent {
[[self controller] mouseDown:theEvent];
[super mouseDown:theEvent];
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698