| 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" |
| 11 #include "chrome/browser/sessions/session_service_factory.h" | 11 #include "chrome/browser/sessions/session_service_factory.h" |
| 12 #include "chrome/browser/sessions/session_types.h" | 12 #include "chrome/browser/sessions/session_types.h" |
| 13 #include "chrome/browser/sessions/persistent_tab_restore_service.h" | 13 #include "chrome/browser/sessions/persistent_tab_restore_service.h" |
| 14 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 14 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 15 #include "chrome/browser/sync/glue/local_device_info_provider_mock.h" | 15 #include "chrome/browser/sync/glue/local_device_info_provider_mock.h" |
| 16 #include "chrome/browser/sync/glue/synced_session.h" | 16 #include "chrome/browser/sync/glue/synced_session.h" |
| 17 #include "chrome/browser/sync/profile_sync_service_mock.h" | 17 #include "chrome/browser/sync/profile_sync_service_mock.h" |
| 18 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" | 18 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_tabstrip.h" | 20 #include "chrome/browser/ui/browser_tabstrip.h" |
| 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 22 #include "chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h" | 22 #include "chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h" |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/test/base/browser_with_test_window_test.h" | 24 #include "chrome/test/base/browser_with_test_window_test.h" |
| 25 #include "chrome/test/base/menu_model_test.h" | 25 #include "chrome/test/base/menu_model_test.h" |
| 26 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
| 27 #include "components/sessions/serialized_navigation_entry_test_helper.h" | 27 #include "components/sessions/serialized_navigation_entry_test_helper.h" |
| 28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 29 #include "grit/generated_resources.h" | |
| 30 #include "sync/api/fake_sync_change_processor.h" | 29 #include "sync/api/fake_sync_change_processor.h" |
| 31 #include "sync/api/sync_error_factory_mock.h" | 30 #include "sync/api/sync_error_factory_mock.h" |
| 32 #include "testing/gmock/include/gmock/gmock.h" | 31 #include "testing/gmock/include/gmock/gmock.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
| 34 | 33 |
| 35 namespace { | 34 namespace { |
| 36 | 35 |
| 37 // This copies parts of MenuModelTest::Delegate and combines them with the | 36 // This copies parts of MenuModelTest::Delegate and combines them with the |
| 38 // RecentTabsSubMenuModel since RecentTabsSubMenuModel is a | 37 // RecentTabsSubMenuModel since RecentTabsSubMenuModel is a |
| 39 // SimpleMenuModel::Delegate and not just derived from SimpleMenuModel. | 38 // SimpleMenuModel::Delegate and not just derived from SimpleMenuModel. |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 // 0 Recently closed heaer (disabled) | 551 // 0 Recently closed heaer (disabled) |
| 553 // 1 <separator> | 552 // 1 <separator> |
| 554 // 2 No tabs from other Devices | 553 // 2 No tabs from other Devices |
| 555 | 554 |
| 556 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 555 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
| 557 EXPECT_EQ(3, model.GetItemCount()); | 556 EXPECT_EQ(3, model.GetItemCount()); |
| 558 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(0)); | 557 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(0)); |
| 559 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(1)); | 558 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(1)); |
| 560 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 559 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
| 561 } | 560 } |
| OLD | NEW |