OLD | NEW |
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_manager.h" | 8 #import "ios/web/public/navigation_manager.h" |
9 | 9 |
10 namespace web { | 10 namespace web { |
11 | 11 |
12 // A minimal implementation of web::NavigationManager that raises NOTREACHED() | 12 // A minimal implementation of web::NavigationManager that raises NOTREACHED() |
13 // on most calls. | 13 // on most calls. |
14 class TestNavigationManager : public web::NavigationManager { | 14 class TestNavigationManager : public NavigationManager { |
15 public: | 15 public: |
16 TestNavigationManager(); | 16 TestNavigationManager(); |
17 ~TestNavigationManager() override; | 17 ~TestNavigationManager() override; |
18 BrowserState* GetBrowserState() const override; | 18 BrowserState* GetBrowserState() const override; |
19 WebState* GetWebState() const override; | 19 WebState* GetWebState() const override; |
20 NavigationItem* GetVisibleItem() const override; | 20 NavigationItem* GetVisibleItem() const override; |
21 NavigationItem* GetLastCommittedItem() const override; | 21 NavigationItem* GetLastCommittedItem() const override; |
22 NavigationItem* GetPendingItem() const override; | 22 NavigationItem* GetPendingItem() const override; |
23 NavigationItem* GetTransientItem() const override; | 23 NavigationItem* GetTransientItem() const override; |
24 void DiscardNonCommittedItems() override; | 24 void DiscardNonCommittedItems() override; |
25 void LoadIfNecessary() override; | 25 void LoadIfNecessary() override; |
26 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; | 26 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; |
27 void AddTransientURLRewriter( | 27 void AddTransientURLRewriter( |
28 BrowserURLRewriter::URLRewriter rewriter) override; | 28 BrowserURLRewriter::URLRewriter rewriter) override; |
29 int GetItemCount() const override; | 29 int GetItemCount() const override; |
30 NavigationItem* GetItemAtIndex(size_t index) const override; | 30 NavigationItem* GetItemAtIndex(size_t index) const override; |
31 int GetCurrentItemIndex() const override; | 31 int GetCurrentItemIndex() const override; |
32 int GetPendingItemIndex() const override; | 32 int GetPendingItemIndex() const override; |
33 int GetLastCommittedItemIndex() const override; | 33 int GetLastCommittedItemIndex() const override; |
34 bool RemoveItemAtIndex(int index) override; | 34 bool RemoveItemAtIndex(int index) override; |
35 bool CanGoBack() const override; | 35 bool CanGoBack() const override; |
36 bool CanGoForward() const override; | 36 bool CanGoForward() const override; |
37 bool CanGoToOffset(int offset) const override; | 37 bool CanGoToOffset(int offset) const override; |
38 void GoBack() override; | 38 void GoBack() override; |
39 void GoForward() override; | 39 void GoForward() override; |
40 void GoToIndex(int index) override; | 40 void GoToIndex(int index) override; |
| 41 NavigationItemList GetBackwardItems() const override; |
| 42 NavigationItemList GetForwardItems() const override; |
41 void Reload(bool check_for_reposts) override; | 43 void Reload(bool check_for_reposts) override; |
| 44 void InsertStateFromManager(const NavigationManager* manager) override; |
42 void OverrideDesktopUserAgentForNextPendingItem() override; | 45 void OverrideDesktopUserAgentForNextPendingItem() override; |
43 | 46 |
44 // Setters for test data. | 47 // Setters for test data. |
45 void SetLastCommittedItem(NavigationItem* item); | 48 void SetLastCommittedItem(NavigationItem* item); |
46 void SetPendingItem(NavigationItem* item); | 49 void SetPendingItem(NavigationItem* item); |
47 void SetVisibleItem(NavigationItem* item); | 50 void SetVisibleItem(NavigationItem* item); |
48 | 51 |
49 private: | 52 private: |
50 NavigationItem* pending_item_; | 53 NavigationItem* pending_item_; |
51 NavigationItem* last_committed_item_; | 54 NavigationItem* last_committed_item_; |
52 NavigationItem* visible_item_; | 55 NavigationItem* visible_item_; |
53 }; | 56 }; |
54 | 57 |
55 } // namespace web | 58 } // namespace web |
56 | 59 |
57 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ | 60 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_NAVIGATION_MANAGER_H_ |
OLD | NEW |