OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | 5 #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "components/sync_driver/glue/synced_window_delegate.h" | 8 #include "components/sync_driver/glue/synced_window_delegate.h" |
9 #include "content/public/browser/navigation_entry.h" | 9 #include "content/public/browser/navigation_entry.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 pending_index_(-1), | 37 pending_index_(-1), |
38 current_index_(0), | 38 current_index_(0), |
39 pending_entry_(NULL), | 39 pending_entry_(NULL), |
40 window_(new FakeSyncedWindowDelegate()) {} | 40 window_(new FakeSyncedWindowDelegate()) {} |
41 | 41 |
42 SessionID::id_type GetWindowId() const override { return 0; } | 42 SessionID::id_type GetWindowId() const override { return 0; } |
43 SessionID::id_type GetSessionId() const override { return 0; } | 43 SessionID::id_type GetSessionId() const override { return 0; } |
44 bool IsBeingDestroyed() const override { return false; } | 44 bool IsBeingDestroyed() const override { return false; } |
45 Profile* profile() const override { return NULL; } | 45 Profile* profile() const override { return NULL; } |
46 std::string GetExtensionAppId() const override { return ""; } | 46 std::string GetExtensionAppId() const override { return ""; } |
| 47 bool IsInitialBlankNavigation() const override { |
| 48 // This differs from NavigationControllerImpl, which has an initial blank |
| 49 // NavigationEntry. |
| 50 return GetEntryCount() == 0; |
| 51 } |
47 int GetCurrentEntryIndex() const override { return current_index_; } | 52 int GetCurrentEntryIndex() const override { return current_index_; } |
48 int GetEntryCount() const override { return indexed_entries_.size(); } | 53 int GetEntryCount() const override { return indexed_entries_.size(); } |
49 int GetPendingEntryIndex() const override { return pending_index_; } | 54 int GetPendingEntryIndex() const override { return pending_index_; } |
50 content::NavigationEntry* GetPendingEntry() const override { | 55 content::NavigationEntry* GetPendingEntry() const override { |
51 return pending_entry_; | 56 return pending_entry_; |
52 } | 57 } |
53 content::NavigationEntry* GetEntryAtIndex(int i) const override { | 58 content::NavigationEntry* GetEntryAtIndex(int i) const override { |
54 return indexed_entries_[i]; | 59 return indexed_entries_[i]; |
55 } | 60 } |
56 content::NavigationEntry* GetActiveEntry() const override { return NULL; } | 61 content::NavigationEntry* GetActiveEntry() const override { return NULL; } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 scoped_ptr<content::NavigationEntry> | 182 scoped_ptr<content::NavigationEntry> |
178 entry3(content::NavigationEntry::Create()); | 183 entry3(content::NavigationEntry::Create()); |
179 entry3->SetURL(GURL("http://www.google.com")); | 184 entry3->SetURL(GURL("http://www.google.com")); |
180 tab_.AppendIndexedEntry(entry3.get()); | 185 tab_.AppendIndexedEntry(entry3.get()); |
181 | 186 |
182 // With one valid, expect true. | 187 // With one valid, expect true. |
183 EXPECT_TRUE(tab_.ShouldSync()); | 188 EXPECT_TRUE(tab_.ShouldSync()); |
184 } | 189 } |
185 | 190 |
186 } // namespace browser_sync | 191 } // namespace browser_sync |
OLD | NEW |