| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/mac/scoped_nsobject.h" | 6 #include "base/mac/scoped_nsobject.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| 11 #include "chrome/browser/sync/profile_sync_service_factory.h" | 11 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 12 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" | 12 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
| 13 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
| 14 #include "chrome/browser/ui/browser_list_observer.h" | 14 #include "chrome/browser/ui/browser_list_observer.h" |
| 15 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 15 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 16 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 16 #include "chrome/browser/ui/cocoa/run_loop_testing.h" |
| 17 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 17 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 18 #import "chrome/browser/ui/cocoa/view_resizer_pong.h" | 18 #import "chrome/browser/ui/cocoa/view_resizer_pong.h" |
| 19 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" | 19 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" |
| 20 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 20 #include "chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h" | 21 #include "chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h" |
| 21 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" | 22 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" |
| 22 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 23 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
| 23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
| 26 #include "components/sync_driver/local_device_info_provider_mock.h" | 27 #include "components/sync_driver/local_device_info_provider_mock.h" |
| 27 #include "grit/theme_resources.h" | 28 #include "grit/theme_resources.h" |
| 28 #include "sync/api/fake_sync_change_processor.h" | 29 #include "sync/api/fake_sync_change_processor.h" |
| 29 #include "sync/api/sync_error_factory_mock.h" | 30 #include "sync/api/sync_error_factory_mock.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 CocoaProfileTest::SetUp(); | 77 CocoaProfileTest::SetUp(); |
| 77 ASSERT_TRUE(browser()); | 78 ASSERT_TRUE(browser()); |
| 78 | 79 |
| 79 controller_.reset([[WrenchMenuController alloc] initWithBrowser:browser()]); | 80 controller_.reset([[WrenchMenuController alloc] initWithBrowser:browser()]); |
| 80 fake_model_.reset(new MockWrenchMenuModel); | 81 fake_model_.reset(new MockWrenchMenuModel); |
| 81 | 82 |
| 82 manager_.reset(new browser_sync::SessionsSyncManager( | 83 manager_.reset(new browser_sync::SessionsSyncManager( |
| 83 profile(), | 84 profile(), |
| 84 local_device_.get(), | 85 local_device_.get(), |
| 85 scoped_ptr<browser_sync::LocalSessionEventRouter>( | 86 scoped_ptr<browser_sync::LocalSessionEventRouter>( |
| 86 new DummyRouter()))); | 87 new DummyRouter()), |
| 88 scoped_ptr<browser_sync::SyncedWindowDelegatesGetter>( |
| 89 new browser_sync::BrowserSyncedWindowDelegatesGetter()))); |
| 87 manager_->MergeDataAndStartSyncing( | 90 manager_->MergeDataAndStartSyncing( |
| 88 syncer::SESSIONS, | 91 syncer::SESSIONS, |
| 89 syncer::SyncDataList(), | 92 syncer::SyncDataList(), |
| 90 scoped_ptr<syncer::SyncChangeProcessor>( | 93 scoped_ptr<syncer::SyncChangeProcessor>( |
| 91 new syncer::FakeSyncChangeProcessor), | 94 new syncer::FakeSyncChangeProcessor), |
| 92 scoped_ptr<syncer::SyncErrorFactory>( | 95 scoped_ptr<syncer::SyncErrorFactory>( |
| 93 new syncer::SyncErrorFactoryMock)); | 96 new syncer::SyncErrorFactoryMock)); |
| 94 } | 97 } |
| 95 | 98 |
| 96 void RegisterRecentTabs(RecentTabsBuilderTestHelper* helper) { | 99 void RegisterRecentTabs(RecentTabsBuilderTestHelper* helper) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 BrowserRemovedObserver observer; | 265 BrowserRemovedObserver observer; |
| 263 // This is normally called by ToolbarController, but since |controller_| is | 266 // This is normally called by ToolbarController, but since |controller_| is |
| 264 // not owned by one, call it here. | 267 // not owned by one, call it here. |
| 265 [controller_ browserWillBeDestroyed]; | 268 [controller_ browserWillBeDestroyed]; |
| 266 CloseBrowserWindow(); | 269 CloseBrowserWindow(); |
| 267 observer.WaitUntilBrowserRemoved(); | 270 observer.WaitUntilBrowserRemoved(); |
| 268 // |controller_| is released in TearDown(). | 271 // |controller_| is released in TearDown(). |
| 269 } | 272 } |
| 270 | 273 |
| 271 } // namespace | 274 } // namespace |
| OLD | NEW |