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

Unified Diff: chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm

Issue 17567007: Made MessagePump a non-thread safe class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved MessageLoopProxyImpl to base::internal. Created 7 years, 5 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
Index: chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm b/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
index 96ab9158e23dd6931507b94493b720f892a2bcac..78bf8a4f261b1ff0e894e4da2bbc9fd4792401b5 100644
--- a/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
@@ -6,7 +6,9 @@
#import <QuartzCore/QuartzCore.h>
-#include "base/memory/ref_counted.h"
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_pump_mac.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#import "third_party/ocmock/gtest_support.h"
@@ -53,7 +55,7 @@ TEST_F(HistoryOverlayControllerTest, DismissClearsAnimations) {
[[HistoryOverlayController alloc] initForMode:kHistoryOverlayModeBack]);
[controller showPanelForView:test_view()];
- scoped_refptr<base::MessagePumpNSRunLoop> message_pump(
+ scoped_ptr<base::MessagePumpNSRunLoop> message_pump(
new base::MessagePumpNSRunLoop);
id mock = [OCMockObject partialMockForObject:controller];
@@ -61,8 +63,10 @@ TEST_F(HistoryOverlayControllerTest, DismissClearsAnimations) {
[[[mock expect] andForwardToRealObject] dismiss];
// Called after |-animationDidStop:finished:|.
+ base::Closure quit_closure = base::Bind(&base::MessagePumpNSRunLoop::Quit,
+ base::Unretained(message_pump.get()));
void (^quit_loop)(NSInvocation* invocation) = ^(NSInvocation* invocation) {
- message_pump->Quit();
+ quit_closure.Run();
Robert Sesek 2013/07/10 22:13:32 Why can't Quit be called directly here?
alexeypa (please no reviews) 2013/07/10 22:15:26 Because |message_pump_| is a scoped_ptr now and ca
Robert Sesek 2013/07/10 22:19:15 Ah, right. I think there's a slight preference to
alexeypa (please no reviews) 2013/07/10 22:27:23 Done.
};
// Set up the mock to first forward to the real implementation and then call
// the above block to quit the run loop.

Powered by Google App Engine
This is Rietveld 408576698