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

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

Issue 6612025: [Mac] Apply CrTrackingArea to the two other places where we get |-mouseMoved:| zombie messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 10 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/cocoa/tracking_area.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tracking_area_unittest.mm
diff --git a/chrome/browser/ui/cocoa/tracking_area_unittest.mm b/chrome/browser/ui/cocoa/tracking_area_unittest.mm
index 2ff125dc672e2cf516119614c1f870bbeb5e2d8a..a812f462099de0ffe4073674b834b8b585a9242b 100644
--- a/chrome/browser/ui/cocoa/tracking_area_unittest.mm
+++ b/chrome/browser/ui/cocoa/tracking_area_unittest.mm
@@ -84,3 +84,31 @@ TEST_F(CrTrackingAreaTest, ZombieOwner) {
ObjcEvilDoers::ZombieDisable();
}
+
+TEST_F(CrTrackingAreaTest, ScoperInit) {
+ {
+ ScopedCrTrackingArea scoper([trackingArea_ retain]);
+ [[scoper.get() owner] performMessage];
+ EXPECT_EQ(1U, [owner_ messageCount]);
+ }
+
+ [[trackingArea_ owner] performMessage];
+ EXPECT_EQ(1U, [owner_ messageCount]);
+}
+
+TEST_F(CrTrackingAreaTest, ScoperReset) {
+ {
+ ScopedCrTrackingArea scoper;
+ EXPECT_FALSE(scoper.get());
+
+ scoper.reset([trackingArea_ retain]);
+ [[scoper.get() owner] performMessage];
+ EXPECT_EQ(1U, [owner_ messageCount]);
+
+ [[scoper.get() owner] performMessage];
+ EXPECT_EQ(2U, [owner_ messageCount]);
+ }
+
+ [[trackingArea_ owner] performMessage];
+ EXPECT_EQ(2U, [owner_ messageCount]);
+}
« no previous file with comments | « chrome/browser/ui/cocoa/tracking_area.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698