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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list_unittest.mm

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 side-by-side diff with in-line comments
Download patch
Index: ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
diff --git a/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm b/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
index 2d2d149b6df6dbdb38c8f974efcff2268caf7d6d..bc06f5c4bc90da64ea5ae1f4edadf7aa2dc02e52 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
+++ b/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
@@ -111,27 +111,29 @@ void WebStateDetachedAt(WebStateList* web_state_list,
FakeNavigationManager() = default;
// web::NavigationManager implementation.
- int GetCurrentItemIndex() const override { return current_item_index_; }
-
- int GetLastCommittedItemIndex() const override { return current_item_index_; }
+ int GetLastCommittedItemIndex() const override {
+ return last_committed_item_index;
+ }
- bool CanGoBack() const override { return current_item_index_ > 0; }
+ bool CanGoBack() const override { return last_committed_item_index > 0; }
- bool CanGoForward() const override { return current_item_index_ < INT_MAX; }
+ bool CanGoForward() const override {
+ return last_committed_item_index < INT_MAX;
+ }
void GoBack() override {
DCHECK(CanGoBack());
- --current_item_index_;
+ --last_committed_item_index;
}
void GoForward() override {
DCHECK(CanGoForward());
- ++current_item_index_;
+ ++last_committed_item_index;
}
- void GoToIndex(int index) override { current_item_index_ = index; }
+ void GoToIndex(int index) override { last_committed_item_index = index; }
- int current_item_index_ = 0;
+ int last_committed_item_index = 0;
DISALLOW_COPY_AND_ASSIGN(FakeNavigationManager);
};

Powered by Google App Engine
This is Rietveld 408576698