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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm

Issue 2766413004: [ios] Change API to inform WebStateList of opener-opened relationship. (Closed)
Patch Set: Address comments. Created 3 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
Index: ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm
diff --git a/ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm b/ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm
index 9977b5c65938cb465835c868e05f5da89bcc986f..2d6a90ed74e5422dc1d2566d12cfa8fa5bd1896d 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm
+++ b/ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm
@@ -8,6 +8,7 @@
#include "base/memory/ptr_util.h"
#import "ios/shared/chrome/browser/tabs/fake_web_state_list_delegate.h"
#import "ios/shared/chrome/browser/tabs/web_state_list.h"
+#import "ios/shared/chrome/browser/tabs/web_state_opener.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -58,8 +59,8 @@ class WebStateListOrderControllerTest : public PlatformTest {
};
TEST_F(WebStateListOrderControllerTest, DetermineInsertionIndex) {
- web_state_list_.InsertWebState(0, CreateWebState(), nullptr);
- web_state_list_.InsertWebState(1, CreateWebState(), nullptr);
+ web_state_list_.InsertWebState(0, CreateWebState());
+ web_state_list_.InsertWebState(1, CreateWebState());
web::WebState* opener = web_state_list_.GetWebStateAt(0);
// Verify that first child WebState is inserted after |opener| if there are
@@ -78,15 +79,17 @@ TEST_F(WebStateListOrderControllerTest, DetermineInsertionIndex) {
// Add a child WebState to |opener|, and verify that a second child would be
// inserted after the first.
- web_state_list_.InsertWebState(2, CreateWebState(), opener);
+ web_state_list_.InsertWebState(2, CreateWebState());
+ web_state_list_.SetOpenerOfWebStateAt(2, WebStateOpener(opener));
EXPECT_EQ(3, order_controller_.DetermineInsertionIndex(
ui::PAGE_TRANSITION_LINK, opener));
// Add a grand-child to |opener|, and verify that adding another child to
// |opener| would be inserted before the grand-child.
- web_state_list_.InsertWebState(3, CreateWebState(),
- web_state_list_.GetWebStateAt(1));
+ web_state_list_.InsertWebState(3, CreateWebState());
+ web_state_list_.SetOpenerOfWebStateAt(
+ 3, WebStateOpener(web_state_list_.GetWebStateAt(1)));
EXPECT_EQ(3, order_controller_.DetermineInsertionIndex(
ui::PAGE_TRANSITION_LINK, opener));

Powered by Google App Engine
This is Rietveld 408576698