Chromium Code Reviews| Index: ios/web/public/test/fakes/test_navigation_manager.h |
| diff --git a/ios/web/public/test/fakes/test_navigation_manager.h b/ios/web/public/test/fakes/test_navigation_manager.h |
| index e36ebb72ecd50381a8c04c4e8822a63681a99e33..a165eacde096605bc8f8504805b720d63999f654 100644 |
| --- a/ios/web/public/test/fakes/test_navigation_manager.h |
| +++ b/ios/web/public/test/fakes/test_navigation_manager.h |
| @@ -5,7 +5,10 @@ |
| #ifndef IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ |
| #define IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ |
| +#import "ios/web/public/navigation_item.h" |
| +#include "ios/web/public/navigation_item_list.h" |
| #import "ios/web/public/navigation_manager.h" |
| +#include "ui/base/page_transition_types.h" |
| namespace web { |
| @@ -42,11 +45,29 @@ class TestNavigationManager : public web::NavigationManager { |
| void OverrideDesktopUserAgentForNextPendingItem() override; |
| // Setters for test data. |
| + // Sets a value for last committed item that will be returned by |
| + // GetLastCommittedItem(). |
| void SetLastCommittedItem(NavigationItem* item); |
| + |
| + // Sets a value for pending item that will be returned by GetPendingItem(). |
| void SetPendingItem(NavigationItem* item); |
| + |
| + // Sets a value for visible item that will be returned by GetVisibleItem(). |
| void SetVisibleItem(NavigationItem* item); |
| + // Adds an item to items_. Affects the return values for, GetItemCount(), |
| + // GetItemAtIndex(), and GetCurrentItemIndex(). |
| + void AddItem(const std::string& url_spec, ui::PageTransition transition); |
|
Eugene But (OOO till 7-30)
2017/03/14 16:52:11
Is there a reason for using url_spec instead of GU
pkl (ping after 24h if needed)
2017/03/14 21:16:19
const GURL& is a better choice. Fixed.
|
| + |
| + // Sets the index to be returned by GetCurrentItemIndex(). |index| must be |
| + // either -1 or between 0 and GetItemCount()-1, inclusively. |
| + void SetCurrentItemIndex(const int index); |
| + |
| private: |
| + // A list of items constructed by calling AddItem(). |
| + web::ScopedNavigationItemList items_; |
| + int items_count_; |
| + // Individual backing instance variables for Set* test set up methods. |
| NavigationItem* pending_item_; |
| NavigationItem* last_committed_item_; |
| NavigationItem* visible_item_; |