OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/sessions/session_service.h" | 10 #include "chrome/browser/sessions/session_service.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 void RegisterRecentTabs(RecentTabsBuilderTestHelper* helper) { | 149 void RegisterRecentTabs(RecentTabsBuilderTestHelper* helper) { |
150 helper->ExportToSessionsSyncManager(manager_.get()); | 150 helper->ExportToSessionsSyncManager(manager_.get()); |
151 } | 151 } |
152 | 152 |
153 virtual scoped_ptr<browser_sync::DeviceInfo> GetLocalDeviceInfo() | 153 virtual scoped_ptr<browser_sync::DeviceInfo> GetLocalDeviceInfo() |
154 const OVERRIDE { | 154 const OVERRIDE { |
155 return scoped_ptr<browser_sync::DeviceInfo>( | 155 return scoped_ptr<browser_sync::DeviceInfo>( |
156 new browser_sync::DeviceInfo(GetLocalSyncCacheGUID(), | 156 new browser_sync::DeviceInfo(GetLocalSyncCacheGUID(), |
157 "Test Machine", | 157 "Test Machine", |
158 "Chromium 10k", | 158 "Chromium 10k", |
159 "Chrome 10k", | 159 "Chrome 10k", |
160 sync_pb::SyncEnums_DeviceType_TYPE_LINUX)); | 160 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, |
| 161 "device_id")); |
161 } | 162 } |
162 | 163 |
163 virtual std::string GetLocalSyncCacheGUID() const OVERRIDE { | 164 virtual std::string GetLocalSyncCacheGUID() const OVERRIDE { |
164 return "RecentTabsSubMenuModelTest"; | 165 return "RecentTabsSubMenuModelTest"; |
165 } | 166 } |
166 | 167 |
167 private: | 168 private: |
168 TestingProfile testing_profile_; | 169 TestingProfile testing_profile_; |
169 testing::NiceMock<ProfileSyncServiceMock> sync_service_; | 170 testing::NiceMock<ProfileSyncServiceMock> sync_service_; |
170 | 171 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // 0 Recently closed heaer (disabled) | 560 // 0 Recently closed heaer (disabled) |
560 // 1 <separator> | 561 // 1 <separator> |
561 // 2 No tabs from other Devices | 562 // 2 No tabs from other Devices |
562 | 563 |
563 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 564 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
564 EXPECT_EQ(3, model.GetItemCount()); | 565 EXPECT_EQ(3, model.GetItemCount()); |
565 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(0)); | 566 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(0)); |
566 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(1)); | 567 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(1)); |
567 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 568 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
568 } | 569 } |
OLD | NEW |