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

Side by Side Diff: ios/web/public/test/fakes/test_navigation_manager.h

Issue 2766063002: Remove the concept of currentItemIndex (Closed)
Patch Set: fix unit tests 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ 5 #ifndef IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_
6 #define IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ 6 #define IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_
7 7
8 #import "ios/web/public/navigation_item.h" 8 #import "ios/web/public/navigation_item.h"
9 #include "ios/web/public/navigation_item_list.h" 9 #include "ios/web/public/navigation_item_list.h"
10 #import "ios/web/public/navigation_manager.h" 10 #import "ios/web/public/navigation_manager.h"
(...skipping 13 matching lines...) Expand all
24 NavigationItem* GetLastCommittedItem() const override; 24 NavigationItem* GetLastCommittedItem() const override;
25 NavigationItem* GetPendingItem() const override; 25 NavigationItem* GetPendingItem() const override;
26 NavigationItem* GetTransientItem() const override; 26 NavigationItem* GetTransientItem() const override;
27 void DiscardNonCommittedItems() override; 27 void DiscardNonCommittedItems() override;
28 void LoadIfNecessary() override; 28 void LoadIfNecessary() override;
29 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; 29 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override;
30 void AddTransientURLRewriter( 30 void AddTransientURLRewriter(
31 BrowserURLRewriter::URLRewriter rewriter) override; 31 BrowserURLRewriter::URLRewriter rewriter) override;
32 int GetItemCount() const override; 32 int GetItemCount() const override;
33 NavigationItem* GetItemAtIndex(size_t index) const override; 33 NavigationItem* GetItemAtIndex(size_t index) const override;
34 int GetCurrentItemIndex() const override;
35 int GetPendingItemIndex() const override; 34 int GetPendingItemIndex() const override;
36 int GetLastCommittedItemIndex() const override; 35 int GetLastCommittedItemIndex() const override;
37 bool RemoveItemAtIndex(int index) override; 36 bool RemoveItemAtIndex(int index) override;
38 bool CanGoBack() const override; 37 bool CanGoBack() const override;
39 bool CanGoForward() const override; 38 bool CanGoForward() const override;
40 bool CanGoToOffset(int offset) const override; 39 bool CanGoToOffset(int offset) const override;
41 void GoBack() override; 40 void GoBack() override;
42 void GoForward() override; 41 void GoForward() override;
43 void GoToIndex(int index) override; 42 void GoToIndex(int index) override;
44 void Reload(ReloadType reload_type, bool check_for_reposts) override; 43 void Reload(ReloadType reload_type, bool check_for_reposts) override;
(...skipping 11 matching lines...) Expand all
56 // Sets a value for pending item that will be returned by GetPendingItem(). 55 // Sets a value for pending item that will be returned by GetPendingItem().
57 void SetPendingItem(NavigationItem* item); 56 void SetPendingItem(NavigationItem* item);
58 57
59 // Sets a value for visible item that will be returned by GetVisibleItem(). 58 // Sets a value for visible item that will be returned by GetVisibleItem().
60 void SetVisibleItem(NavigationItem* item); 59 void SetVisibleItem(NavigationItem* item);
61 60
62 // Adds an item to items_. Affects the return values for, GetItemCount(), 61 // Adds an item to items_. Affects the return values for, GetItemCount(),
63 // GetItemAtIndex(), and GetCurrentItemIndex(). 62 // GetItemAtIndex(), and GetCurrentItemIndex().
64 void AddItem(const GURL& url, ui::PageTransition transition); 63 void AddItem(const GURL& url, ui::PageTransition transition);
65 64
66 // Sets the index to be returned by GetCurrentItemIndex(). |index| must be 65 // Sets the index to be returned by GetLastCommittedItemIndex(). |index| must
67 // either -1 or between 0 and GetItemCount()-1, inclusively. 66 // be either -1 or between 0 and GetItemCount()-1, inclusively.
68 void SetCurrentItemIndex(const int index); 67 void SetLastCommittedItemIndex(const int index);
69 68
70 private: 69 private:
71 // A list of items constructed by calling AddItem(). 70 // A list of items constructed by calling AddItem().
72 web::ScopedNavigationItemList items_; 71 web::ScopedNavigationItemList items_;
73 int items_index_; 72 int items_index_;
74 // Individual backing instance variables for Set* test set up methods. 73 // Individual backing instance variables for Set* test set up methods.
75 NavigationItem* pending_item_; 74 NavigationItem* pending_item_;
76 NavigationItem* last_committed_item_; 75 NavigationItem* last_committed_item_;
77 NavigationItem* visible_item_; 76 NavigationItem* visible_item_;
78 }; 77 };
79 78
80 } // namespace web 79 } // namespace web
81 80
82 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ 81 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_
OLDNEW
« no previous file with comments | « ios/web/public/navigation_manager.h ('k') | ios/web/public/test/fakes/test_navigation_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698