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

Side by Side Diff: ios/web/navigation/navigation_manager_impl_unittest.mm

Issue 1360993002: Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compilation fix after rebase Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/scoped_nsobject.h" 8 #import "base/mac/scoped_nsobject.h"
9 #import "ios/web/navigation/crw_session_controller+private_constructors.h" 9 #import "ios/web/navigation/crw_session_controller+private_constructors.h"
10 #import "ios/web/navigation/navigation_manager_delegate.h" 10 #import "ios/web/navigation/navigation_manager_delegate.h"
(...skipping 10 matching lines...) Expand all
21 void OnNavigationItemsPruned(size_t pruned_item_count) override {} 21 void OnNavigationItemsPruned(size_t pruned_item_count) override {}
22 void OnNavigationItemChanged() override{}; 22 void OnNavigationItemChanged() override{};
23 void OnNavigationItemCommitted(const LoadCommittedDetails&) override {} 23 void OnNavigationItemCommitted(const LoadCommittedDetails&) override {}
24 WebState* GetWebState() override { return nullptr; } 24 WebState* GetWebState() override { return nullptr; }
25 }; 25 };
26 } // namespace 26 } // namespace
27 27
28 // Test fixture for NavigationManagerImpl testing. 28 // Test fixture for NavigationManagerImpl testing.
29 class NavigationManagerTest : public PlatformTest { 29 class NavigationManagerTest : public PlatformTest {
30 protected: 30 protected:
31 NavigationManagerTest() 31 NavigationManagerTest() : manager_(new NavigationManagerImpl()) {
32 : manager_(new NavigationManagerImpl(&delegate_, &browser_state_)) { 32 manager_->SetDelegate(&delegate_);
33 manager_->SetBrowserState(&browser_state_);
33 controller_.reset([[CRWSessionController alloc] 34 controller_.reset([[CRWSessionController alloc]
34 initWithWindowName:nil 35 initWithWindowName:nil
35 openerId:nil 36 openerId:nil
36 openedByDOM:NO 37 openedByDOM:NO
37 openerNavigationIndex:0 38 openerNavigationIndex:0
38 browserState:&browser_state_]); 39 browserState:&browser_state_]);
39 manager_->SetSessionController(controller_.get()); 40 manager_->SetSessionController(controller_.get());
40 } 41 }
41 CRWSessionController* session_controller() { return controller_.get(); } 42 CRWSessionController* session_controller() { return controller_.get(); }
42 NavigationManagerImpl* navigation_manager() { return manager_.get(); } 43 NavigationManagerImpl* navigation_manager() { return manager_.get(); }
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 [session_controller() goToEntryAtIndex:0]; 523 [session_controller() goToEntryAtIndex:0];
523 [session_controller() setPendingEntryIndex:1]; 524 [session_controller() setPendingEntryIndex:1];
524 ASSERT_EQ(3, navigation_manager()->GetItemCount()); 525 ASSERT_EQ(3, navigation_manager()->GetItemCount());
525 ASSERT_EQ(0, navigation_manager()->GetCurrentItemIndex()); 526 ASSERT_EQ(0, navigation_manager()->GetCurrentItemIndex());
526 ASSERT_EQ(1, navigation_manager()->GetPendingItemIndex()); 527 ASSERT_EQ(1, navigation_manager()->GetPendingItemIndex());
527 EXPECT_EQ(2, navigation_manager()->GetIndexForOffset(1)); 528 EXPECT_EQ(2, navigation_manager()->GetIndexForOffset(1));
528 EXPECT_EQ(0, navigation_manager()->GetIndexForOffset(-1)); 529 EXPECT_EQ(0, navigation_manager()->GetIndexForOffset(-1));
529 } 530 }
530 531
531 } // namespace web 532 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.mm ('k') | ios/web/navigation/navigation_manager_storage_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698