OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/toolbar/recent_tabs_sub_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 scoped_ptr<syncer::SyncErrorFactory>( | 137 scoped_ptr<syncer::SyncErrorFactory>( |
138 new syncer::SyncErrorFactoryMock)); | 138 new syncer::SyncErrorFactoryMock)); |
139 } | 139 } |
140 | 140 |
141 void WaitForLoadFromLastSession() { | 141 void WaitForLoadFromLastSession() { |
142 content::RunAllBlockingPoolTasksUntilIdle(); | 142 content::RunAllBlockingPoolTasksUntilIdle(); |
143 } | 143 } |
144 | 144 |
145 static scoped_ptr<KeyedService> GetTabRestoreService( | 145 static scoped_ptr<KeyedService> GetTabRestoreService( |
146 content::BrowserContext* browser_context) { | 146 content::BrowserContext* browser_context) { |
147 return make_scoped_ptr(new PersistentTabRestoreService( | 147 return make_scoped_ptr(new sessions::PersistentTabRestoreService( |
148 make_scoped_ptr(new ChromeTabRestoreServiceClient( | 148 make_scoped_ptr(new ChromeTabRestoreServiceClient( |
149 Profile::FromBrowserContext(browser_context))), | 149 Profile::FromBrowserContext(browser_context))), |
150 nullptr)); | 150 nullptr)); |
151 } | 151 } |
152 | 152 |
153 sync_driver::OpenTabsUIDelegate* GetOpenTabsDelegate() { | 153 sync_driver::OpenTabsUIDelegate* GetOpenTabsDelegate() { |
154 return manager_.get(); | 154 return manager_.get(); |
155 } | 155 } |
156 | 156 |
157 void RegisterRecentTabs(RecentTabsBuilderTestHelper* helper) { | 157 void RegisterRecentTabs(RecentTabsBuilderTestHelper* helper) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 // 2 Recently closed heaer (disabled) | 594 // 2 Recently closed heaer (disabled) |
595 // 3 <separator> | 595 // 3 <separator> |
596 // 4 No tabs from other Devices | 596 // 4 No tabs from other Devices |
597 | 597 |
598 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 598 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
599 EXPECT_EQ(5, model.GetItemCount()); | 599 EXPECT_EQ(5, model.GetItemCount()); |
600 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 600 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
601 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); | 601 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); |
602 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); | 602 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); |
603 } | 603 } |
OLD | NEW |