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

Unified Diff: ios/chrome/browser/ui/util/label_observer_unittest.mm

Issue 2828743002: LabelObserver is no longer retained by the label (Closed)
Patch Set: Address comments Created 3 years, 8 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 | « ios/chrome/browser/ui/util/label_observer.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/util/label_observer_unittest.mm
diff --git a/ios/chrome/browser/ui/util/label_observer_unittest.mm b/ios/chrome/browser/ui/util/label_observer_unittest.mm
index 56119f626932782f4edc373c8b2882dd7da148e2..ea8633457752ae8d9724cb372362c02878b04a90 100644
--- a/ios/chrome/browser/ui/util/label_observer_unittest.mm
+++ b/ios/chrome/browser/ui/util/label_observer_unittest.mm
@@ -17,12 +17,17 @@ class LabelObserverTest : public PlatformTest {
protected:
void SetUp() override {
label_.reset([[UILabel alloc] initWithFrame:CGRectZero]);
+ observer_.reset([[LabelObserver observerForLabel:label_.get()] retain]);
+ [observer_ startObserving];
}
+ ~LabelObserverTest() override { [observer_ stopObserving]; }
+
UILabel* label() { return label_.get(); }
- LabelObserver* observer() { return [LabelObserver observerForLabel:label()]; }
+ LabelObserver* observer() { return observer_.get(); }
base::scoped_nsobject<UILabel> label_;
+ base::scoped_nsobject<LabelObserver> observer_;
};
// Tests that all types of LabelObserverActions are successfully called.
« no previous file with comments | « ios/chrome/browser/ui/util/label_observer.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698