Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/ui/cocoa/app_menu/app_menu_controller_unittest.mm

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 public: 53 public:
54 ~DummyRouter() override {} 54 ~DummyRouter() override {}
55 void StartRoutingTo( 55 void StartRoutingTo(
56 sync_sessions::LocalSessionEventHandler* handler) override {} 56 sync_sessions::LocalSessionEventHandler* handler) override {}
57 void Stop() override {} 57 void Stop() override {}
58 }; 58 };
59 59
60 class AppMenuControllerTest : public CocoaProfileTest { 60 class AppMenuControllerTest : public CocoaProfileTest {
61 public: 61 public:
62 AppMenuControllerTest() 62 AppMenuControllerTest()
63 : local_device_(new syncer::LocalDeviceInfoProviderMock( 63 : local_device_(new sync_driver::LocalDeviceInfoProviderMock(
64 "AppMenuControllerTest", 64 "AppMenuControllerTest",
65 "Test Machine", 65 "Test Machine",
66 "Chromium 10k", 66 "Chromium 10k",
67 "Chrome 10k", 67 "Chrome 10k",
68 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, 68 sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
69 "device_id")) {} 69 "device_id")) {
70 }
70 71
71 void SetUp() override { 72 void SetUp() override {
72 CocoaProfileTest::SetUp(); 73 CocoaProfileTest::SetUp();
73 ASSERT_TRUE(browser()); 74 ASSERT_TRUE(browser());
74 75
75 controller_.reset([[AppMenuController alloc] initWithBrowser:browser()]); 76 controller_.reset([[AppMenuController alloc] initWithBrowser:browser()]);
76 fake_model_.reset(new MockAppMenuModel); 77 fake_model_.reset(new MockAppMenuModel);
77 78
78 sync_prefs_.reset(new syncer::SyncPrefs(profile()->GetPrefs())); 79 sync_prefs_.reset(new sync_driver::SyncPrefs(profile()->GetPrefs()));
79 manager_.reset(new sync_sessions::SessionsSyncManager( 80 manager_.reset(new sync_sessions::SessionsSyncManager(
80 ProfileSyncServiceFactory::GetForProfile(profile()) 81 ProfileSyncServiceFactory::GetForProfile(profile())
81 ->GetSyncClient() 82 ->GetSyncClient()
82 ->GetSyncSessionsClient(), 83 ->GetSyncSessionsClient(),
83 sync_prefs_.get(), local_device_.get(), 84 sync_prefs_.get(), local_device_.get(),
84 std::unique_ptr<sync_sessions::LocalSessionEventRouter>( 85 std::unique_ptr<sync_sessions::LocalSessionEventRouter>(
85 new DummyRouter()), 86 new DummyRouter()),
86 base::Closure(), base::Closure())); 87 base::Closure(), base::Closure()));
87 manager_->MergeDataAndStartSyncing( 88 manager_->MergeDataAndStartSyncing(
88 syncer::SESSIONS, syncer::SyncDataList(), 89 syncer::SESSIONS, syncer::SyncDataList(),
(...skipping 20 matching lines...) Expand all
109 110
110 AppMenuController* controller() { 111 AppMenuController* controller() {
111 return controller_.get(); 112 return controller_.get();
112 } 113 }
113 114
114 base::scoped_nsobject<AppMenuController> controller_; 115 base::scoped_nsobject<AppMenuController> controller_;
115 116
116 std::unique_ptr<MockAppMenuModel> fake_model_; 117 std::unique_ptr<MockAppMenuModel> fake_model_;
117 118
118 private: 119 private:
119 std::unique_ptr<syncer::SyncPrefs> sync_prefs_; 120 std::unique_ptr<sync_driver::SyncPrefs> sync_prefs_;
120 std::unique_ptr<sync_sessions::SessionsSyncManager> manager_; 121 std::unique_ptr<sync_sessions::SessionsSyncManager> manager_;
121 std::unique_ptr<syncer::LocalDeviceInfoProviderMock> local_device_; 122 std::unique_ptr<sync_driver::LocalDeviceInfoProviderMock> local_device_;
122 }; 123 };
123 124
124 TEST_F(AppMenuControllerTest, Initialized) { 125 TEST_F(AppMenuControllerTest, Initialized) {
125 EXPECT_TRUE([controller() menu]); 126 EXPECT_TRUE([controller() menu]);
126 EXPECT_GE([[controller() menu] numberOfItems], 5); 127 EXPECT_GE([[controller() menu] numberOfItems], 5);
127 } 128 }
128 129
129 TEST_F(AppMenuControllerTest, DispatchSimple) { 130 TEST_F(AppMenuControllerTest, DispatchSimple) {
130 base::scoped_nsobject<NSButton> button([[NSButton alloc] init]); 131 base::scoped_nsobject<NSButton> button([[NSButton alloc] init]);
131 [button setTag:IDC_ZOOM_PLUS]; 132 [button setTag:IDC_ZOOM_PLUS];
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 BrowserRemovedObserver observer; 263 BrowserRemovedObserver observer;
263 // This is normally called by ToolbarController, but since |controller_| is 264 // This is normally called by ToolbarController, but since |controller_| is
264 // not owned by one, call it here. 265 // not owned by one, call it here.
265 [controller_ browserWillBeDestroyed]; 266 [controller_ browserWillBeDestroyed];
266 CloseBrowserWindow(); 267 CloseBrowserWindow();
267 observer.WaitUntilBrowserRemoved(); 268 observer.WaitUntilBrowserRemoved();
268 // |controller_| is released in TearDown(). 269 // |controller_| is released in TearDown().
269 } 270 }
270 271
271 } // namespace 272 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/avatar_button_error_controller.cc ('k') | chrome/browser/ui/passwords/manage_passwords_view_utils_desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698