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 <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
26 #include "chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h" | 26 #include "chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h" |
27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/test/base/browser_with_test_window_test.h" | 28 #include "chrome/test/base/browser_with_test_window_test.h" |
29 #include "chrome/test/base/menu_model_test.h" | 29 #include "chrome/test/base/menu_model_test.h" |
30 #include "chrome/test/base/testing_profile.h" | 30 #include "chrome/test/base/testing_profile.h" |
31 #include "components/browser_sync/browser/profile_sync_service_mock.h" | 31 #include "components/browser_sync/browser/profile_sync_service_mock.h" |
32 #include "components/sessions/core/persistent_tab_restore_service.h" | 32 #include "components/sessions/core/persistent_tab_restore_service.h" |
33 #include "components/sessions/core/serialized_navigation_entry_test_helper.h" | 33 #include "components/sessions/core/serialized_navigation_entry_test_helper.h" |
34 #include "components/sessions/core/session_types.h" | 34 #include "components/sessions/core/session_types.h" |
| 35 #include "components/sync/api/fake_sync_change_processor.h" |
| 36 #include "components/sync/api/sync_error_factory_mock.h" |
35 #include "components/sync_driver/local_device_info_provider_mock.h" | 37 #include "components/sync_driver/local_device_info_provider_mock.h" |
36 #include "components/sync_driver/sync_client.h" | 38 #include "components/sync_driver/sync_client.h" |
37 #include "components/sync_driver/sync_prefs.h" | 39 #include "components/sync_driver/sync_prefs.h" |
38 #include "components/sync_sessions/sessions_sync_manager.h" | 40 #include "components/sync_sessions/sessions_sync_manager.h" |
39 #include "components/sync_sessions/synced_session.h" | 41 #include "components/sync_sessions/synced_session.h" |
40 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
41 #include "content/public/test/test_utils.h" | 43 #include "content/public/test/test_utils.h" |
42 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
43 #include "sync/api/fake_sync_change_processor.h" | |
44 #include "sync/api/sync_error_factory_mock.h" | |
45 #include "testing/gmock/include/gmock/gmock.h" | 45 #include "testing/gmock/include/gmock/gmock.h" |
46 #include "testing/gtest/include/gtest/gtest.h" | 46 #include "testing/gtest/include/gtest/gtest.h" |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 // This copies parts of MenuModelTest::Delegate and combines them with the | 50 // This copies parts of MenuModelTest::Delegate and combines them with the |
51 // RecentTabsSubMenuModel since RecentTabsSubMenuModel is a | 51 // RecentTabsSubMenuModel since RecentTabsSubMenuModel is a |
52 // SimpleMenuModel::Delegate and not just derived from SimpleMenuModel. | 52 // SimpleMenuModel::Delegate and not just derived from SimpleMenuModel. |
53 class TestRecentTabsSubMenuModel : public RecentTabsSubMenuModel { | 53 class TestRecentTabsSubMenuModel : public RecentTabsSubMenuModel { |
54 public: | 54 public: |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 // 2 Recently closed heaer (disabled) | 608 // 2 Recently closed heaer (disabled) |
609 // 3 <separator> | 609 // 3 <separator> |
610 // 4 No tabs from other Devices | 610 // 4 No tabs from other Devices |
611 | 611 |
612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); | 612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); |
613 EXPECT_EQ(5, model.GetItemCount()); | 613 EXPECT_EQ(5, model.GetItemCount()); |
614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); | 614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); |
615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); | 615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); |
616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); | 616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); |
617 } | 617 } |
OLD | NEW |