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

Unified Diff: ios/chrome/browser/tabs/tab_model_unittest.mm

Issue 2720613005: Refactor serialisation of openerId & openerNavigationIndex. (Closed)
Patch Set: Fix CRWSessionController's initializer comment. 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/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model_unittest.mm
diff --git a/ios/chrome/browser/tabs/tab_model_unittest.mm b/ios/chrome/browser/tabs/tab_model_unittest.mm
index 5c06b91f863d397467257e4150c4202550a92382..e06edc0dcbc67321084cd051864c13acc2411893 100644
--- a/ios/chrome/browser/tabs/tab_model_unittest.mm
+++ b/ios/chrome/browser/tabs/tab_model_unittest.mm
@@ -26,6 +26,7 @@
#import "ios/web/navigation/navigation_manager_impl.h"
#import "ios/web/public/navigation_manager.h"
#include "ios/web/public/referrer.h"
+#import "ios/web/public/serializable_user_data_manager.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
#include "ios/web/public/test/test_web_thread_bundle.h"
#include "ios/web/public/web_thread.h"
@@ -70,8 +71,7 @@ using web::WebStateImpl;
auto webStateImpl = base::MakeUnique<WebStateImpl>(browserState);
webStateImpl->SetWebController(webControllerMock);
- webStateImpl->GetNavigationManagerImpl().InitializeSession(windowName,
- @"opener", NO, -1);
+ webStateImpl->GetNavigationManagerImpl().InitializeSession(windowName, NO);
[webStateImpl->GetNavigationManagerImpl().GetSessionController()
setLastVisitedTimestamp:lastVisitedTimestamp];
@@ -161,8 +161,16 @@ class TabModelTest : public PlatformTest {
NSString* opener,
NSInteger index) {
auto webState = base::MakeUnique<WebStateImpl>(chrome_browser_state_.get());
- webState->GetNavigationManagerImpl().InitializeSession(windowName, opener,
- NO, index);
+ webState->GetNavigationManagerImpl().InitializeSession(windowName, NO);
+ if ([opener length] != 0) {
+ // Duplicate code from Tab initializer. Will be removed once the code
+ // is rewritten to remove the use of internal ios/web/ API (see issue
+ // http://crbug.com/620465 for progress).
+ web::SerializableUserDataManager* userDataManager =
+ web::SerializableUserDataManager::FromWebState(webState.get());
+ userDataManager->AddSerializableData(opener, @"OpenerID");
+ userDataManager->AddSerializableData(@(index), @"OpenerNavigationIndex");
+ }
return webState;
}
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698