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: ios/shared/chrome/browser/tabs/web_state_list_unittest.mm

Issue 2710183003: Fix WebStateListObserver::WebStateDetachedAt() parameter lifetime. (Closed)
Patch Set: Fix typos. Created 3 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 | « ios/shared/chrome/browser/tabs/web_state_list.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
diff --git a/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm b/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
index 2ed665fea82701deb6f1783e3548b1925759cd27..b1e567d8a764ff78c37b717b6b7a7d2bc374a5a0 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
+++ b/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
@@ -328,7 +328,8 @@ TEST_F(WebStateListTest, DetachWebStateAtIndexBegining) {
EXPECT_EQ(kURL2, web_state_list_.GetWebStateAt(2)->GetVisibleURL().spec());
observer_.ResetStatistics();
- web_state_list_.DetachWebStateAt(0);
+ std::unique_ptr<web::WebState> old_web_state(
+ web_state_list_.DetachWebStateAt(0));
EXPECT_TRUE(observer_.web_state_detached_called());
EXPECT_EQ(2, web_state_list_.count());
@@ -348,7 +349,8 @@ TEST_F(WebStateListTest, DetachWebStateAtIndexMiddle) {
EXPECT_EQ(kURL2, web_state_list_.GetWebStateAt(2)->GetVisibleURL().spec());
observer_.ResetStatistics();
- web_state_list_.DetachWebStateAt(1);
+ std::unique_ptr<web::WebState> old_web_state(
+ web_state_list_.DetachWebStateAt(1));
EXPECT_TRUE(observer_.web_state_detached_called());
EXPECT_EQ(2, web_state_list_.count());
@@ -368,7 +370,8 @@ TEST_F(WebStateListTest, DetachWebStateAtIndexLast) {
EXPECT_EQ(kURL2, web_state_list_.GetWebStateAt(2)->GetVisibleURL().spec());
observer_.ResetStatistics();
- web_state_list_.DetachWebStateAt(2);
+ std::unique_ptr<web::WebState> old_web_state(
+ web_state_list_.DetachWebStateAt(2));
EXPECT_TRUE(observer_.web_state_detached_called());
EXPECT_EQ(2, web_state_list_.count());
« no previous file with comments | « ios/shared/chrome/browser/tabs/web_state_list.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698