summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc')
-rw-r--r--chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc37
1 files changed, 19 insertions, 18 deletions
diff --git a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
index e06ad8c..ccac778 100644
--- a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
+++ b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/sessions/session_types.h"
#include "chrome/browser/sync/glue/device_info.h"
+#include "chrome/browser/sync/glue/local_device_info_provider_mock.h"
#include "chrome/browser/sync/glue/session_sync_test_helper.h"
#include "chrome/browser/sync/glue/synced_tab_delegate.h"
#include "chrome/browser/sync/glue/synced_window_delegate.h"
@@ -228,17 +229,25 @@ scoped_ptr<LocalSessionEventRouter> NewDummyRouter() {
} // namespace
class SessionsSyncManagerTest
- : public BrowserWithTestWindowTest,
- public SessionsSyncManager::SyncInternalApiDelegate {
+ : public BrowserWithTestWindowTest {
public:
- SessionsSyncManagerTest() : test_processor_(NULL) {}
+ SessionsSyncManagerTest()
+ : test_processor_(NULL) {
+ local_device_.reset(new LocalDeviceInfoProviderMock(
+ "cache_guid",
+ "Wayne Gretzky's Hacking Box",
+ "Chromium 10k",
+ "Chrome 10k",
+ sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
+ "device_id"));
+ }
virtual void SetUp() OVERRIDE {
BrowserWithTestWindowTest::SetUp();
browser_sync::NotificationServiceSessionsRouter* router(
new browser_sync::NotificationServiceSessionsRouter(
profile(), syncer::SyncableService::StartSyncFlare()));
- manager_.reset(new SessionsSyncManager(profile(), this,
+ manager_.reset(new SessionsSyncManager(profile(), local_device_.get(),
scoped_ptr<LocalSessionEventRouter>(router)));
}
@@ -249,22 +258,13 @@ class SessionsSyncManagerTest
BrowserWithTestWindowTest::TearDown();
}
- virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE {
- return scoped_ptr<DeviceInfo>(
- new DeviceInfo(GetLocalSyncCacheGUID(),
- "Wayne Gretzky's Hacking Box",
- "Chromium 10k",
- "Chrome 10k",
- sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
- "device_id"));
- }
-
- virtual std::string GetLocalSyncCacheGUID() const OVERRIDE {
- return "cache_guid";
+ const DeviceInfo* GetLocalDeviceInfo() {
+ return local_device_->GetLocalDeviceInfo();
}
SessionsSyncManager* manager() { return manager_.get(); }
SessionSyncTestHelper* helper() { return &helper_; }
+ LocalDeviceInfoProvider* local_device() { return local_device_.get(); }
void InitWithSyncDataTakeOutput(const syncer::SyncDataList& initial_data,
syncer::SyncChangeList* output) {
@@ -314,6 +314,7 @@ class SessionsSyncManagerTest
scoped_ptr<SessionsSyncManager> manager_;
SessionSyncTestHelper helper_;
TestSyncProcessorStub* test_processor_;
+ scoped_ptr<LocalDeviceInfoProviderMock> local_device_;
};
// Test that the SyncSessionManager can properly fill in a SessionHeader.
@@ -686,7 +687,7 @@ TEST_F(SessionsSyncManagerTest, MergeLocalSessionNoTabs) {
syncer::AttachmentServiceProxyForTest::Create()));
syncer::SyncDataList in(&d, &d + 1);
out.clear();
- SessionsSyncManager manager2(profile(), this, NewDummyRouter());
+ SessionsSyncManager manager2(profile(), local_device(), NewDummyRouter());
syncer::SyncMergeResult result = manager2.MergeDataAndStartSyncing(
syncer::SESSIONS, in,
scoped_ptr<syncer::SyncChangeProcessor>(
@@ -1274,7 +1275,7 @@ TEST_F(SessionsSyncManagerTest, SaveUnassociatedNodesForReassociation) {
syncer::AttachmentServiceProxyForTest::Create()));
syncer::SyncDataList in(&d, &d + 1);
changes.clear();
- SessionsSyncManager manager2(profile(), this, NewDummyRouter());
+ SessionsSyncManager manager2(profile(), local_device(), NewDummyRouter());
syncer::SyncMergeResult result = manager2.MergeDataAndStartSyncing(
syncer::SESSIONS, in,
scoped_ptr<syncer::SyncChangeProcessor>(