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

Unified Diff: ios/chrome/browser/sessions/session_window_unittest.mm

Issue 2755823002: Moved |openedByDOM| to WebState's CreateParams and public interface. (Closed)
Patch Set: BVC session controller cleanup 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/chrome/browser/sessions/session_window_unittest.mm
diff --git a/ios/chrome/browser/sessions/session_window_unittest.mm b/ios/chrome/browser/sessions/session_window_unittest.mm
index 15508700496f76af83d555ed462ada726288e168..5d9edd9f649245618cad430f61afbbeb6c747c61 100644
--- a/ios/chrome/browser/sessions/session_window_unittest.mm
+++ b/ios/chrome/browser/sessions/session_window_unittest.mm
@@ -22,8 +22,6 @@
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
-using web::WebStateImpl;
-
@interface SessionWindowIOS (Testing)
- (void)clearSessions;
@@ -40,10 +38,10 @@ void SetUp() override {
chrome_browser_state_ = test_cbs_builder.Build();
}
- WebStateImpl* CreateWebState(BOOL openedByDOM) const {
- WebStateImpl* webState = new WebStateImpl(chrome_browser_state_.get());
- webState->GetNavigationManagerImpl().InitializeSession(openedByDOM);
- return webState;
+ std::unique_ptr<web::WebState> CreateWebState(bool opened_by_dom) const {
+ web::WebState::CreateParams params(chrome_browser_state_.get());
+ params.opened_by_dom = opened_by_dom;
+ return web::WebState::Create(params);
}
web::TestWebThreadBundle thread_bundle_;
@@ -59,8 +57,8 @@ void SetUp() override {
}
TEST_F(SessionWindowIOSTest, InitAddingSessions) {
- std::unique_ptr<WebStateImpl> webState1(CreateWebState(NO));
- std::unique_ptr<WebStateImpl> webState2(CreateWebState(NO));
+ std::unique_ptr<web::WebState> webState1 = CreateWebState(false);
Eugene But (OOO till 7-30) 2017/03/16 15:31:19 nit: false /*opened_by_dom*/
kkhorimoto 2017/03/17 23:04:49 Done.
+ std::unique_ptr<web::WebState> webState2 = CreateWebState(false);
base::scoped_nsobject<SessionWindowIOS> sessionWindow(
[[SessionWindowIOS alloc] init]);
[sessionWindow addSerializedSessionStorage:webState1->BuildSessionStorage()];
@@ -77,8 +75,8 @@ void SetUp() override {
base::scoped_nsobject<SessionWindowIOS> sessionWindow(
[[SessionWindowIOS alloc] init]);
- std::unique_ptr<WebStateImpl> webState1(CreateWebState(YES));
- std::unique_ptr<WebStateImpl> webState2(CreateWebState(NO));
+ std::unique_ptr<web::WebState> webState1 = CreateWebState(true);
Eugene But (OOO till 7-30) 2017/03/16 15:31:19 ditto
kkhorimoto 2017/03/17 23:04:49 Done.
+ std::unique_ptr<web::WebState> webState2 = CreateWebState(false);
[sessionWindow addSerializedSessionStorage:webState1->BuildSessionStorage()];
[sessionWindow addSerializedSessionStorage:webState2->BuildSessionStorage()];

Powered by Google App Engine
This is Rietveld 408576698