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

Unified Diff: base/ios/weak_nsobject_unittest.mm

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « base/ios/weak_nsobject.h ('k') | base/json/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/ios/weak_nsobject_unittest.mm
diff --git a/base/ios/weak_nsobject_unittest.mm b/base/ios/weak_nsobject_unittest.mm
index 325dcd21aad84f7a2cb7c6608ccb0fb3d0935358..81de993cf25222542fc1122b5b7de5772a386712 100644
--- a/base/ios/weak_nsobject_unittest.mm
+++ b/base/ios/weak_nsobject_unittest.mm
@@ -109,8 +109,12 @@ void TouchWeakData(const WeakNSObject<NSMutableData>& weak_data) {
// the weak object on its original thread.
void CopyWeakNSObjectAndPost(const WeakNSObject<NSMutableData>& weak_object,
scoped_refptr<SingleThreadTaskRunner> runner) {
- WeakNSObject<NSMutableData> weak_copy(weak_object);
- runner->PostTask(FROM_HERE, Bind(&TouchWeakData, weak_copy));
+ // Copy using constructor.
+ WeakNSObject<NSMutableData> weak_copy1(weak_object);
+ runner->PostTask(FROM_HERE, Bind(&TouchWeakData, weak_copy1));
+ // Copy using assignment operator.
+ WeakNSObject<NSMutableData> weak_copy2 = weak_object;
+ runner->PostTask(FROM_HERE, Bind(&TouchWeakData, weak_copy2));
}
// Tests that the weak object can be copied on a different thread.
@@ -128,8 +132,8 @@ TEST(WeakNSObjectTest, WeakNSObjectCopyOnOtherThread) {
other_thread.Stop();
loop.RunUntilIdle();
- // Check that TouchWeakData was called.
- EXPECT_EQ(1u, [data length]);
+ // Check that TouchWeakData was called and the object touched twice.
+ EXPECT_EQ(2u, [data length]);
}
} // namespace
« no previous file with comments | « base/ios/weak_nsobject.h ('k') | base/json/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698