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

Side by Side Diff: chrome/browser/sync/glue/synced_device_tracker_unittest.cc

Issue 12212048: Linux/ChromeOS Chromium style checker cleanup, chrome/browser edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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 <string> 5 #include <string>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/sync/glue/device_info.h" 10 #include "chrome/browser/sync/glue/device_info.h"
11 #include "chrome/browser/sync/glue/synced_device_tracker.h" 11 #include "chrome/browser/sync/glue/synced_device_tracker.h"
12 #include "sync/internal_api/public/base/model_type.h" 12 #include "sync/internal_api/public/base/model_type.h"
13 #include "sync/internal_api/public/test/test_user_share.h" 13 #include "sync/internal_api/public/test/test_user_share.h"
14 #include "sync/protocol/sync.pb.h" 14 #include "sync/protocol/sync.pb.h"
15 #include "sync/syncable/directory.h" 15 #include "sync/syncable/directory.h"
16 #include "sync/test/test_transaction_observer.h" 16 #include "sync/test/test_transaction_observer.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace browser_sync { 19 namespace browser_sync {
20 20
21 class SyncedDeviceTrackerTest : public ::testing::Test { 21 class SyncedDeviceTrackerTest : public ::testing::Test {
22 protected: 22 protected:
23 SyncedDeviceTrackerTest() : transaction_count_baseline_(0) { } 23 SyncedDeviceTrackerTest() : transaction_count_baseline_(0) { }
24 ~SyncedDeviceTrackerTest() { } 24 virtual ~SyncedDeviceTrackerTest() { }
25 25
26 void SetUp() { 26 virtual void SetUp() {
27 test_user_share_.SetUp(); 27 test_user_share_.SetUp();
28 syncer::TestUserShare::CreateRoot(syncer::DEVICE_INFO, user_share()); 28 syncer::TestUserShare::CreateRoot(syncer::DEVICE_INFO, user_share());
29 29
30 synced_device_tracker_.reset( 30 synced_device_tracker_.reset(
31 new SyncedDeviceTracker(user_share(), 31 new SyncedDeviceTracker(user_share(),
32 user_share()->directory->cache_guid())); 32 user_share()->directory->cache_guid()));
33 33
34 // We don't actually touch the Profile, so we can get away with passing in a 34 // We don't actually touch the Profile, so we can get away with passing in a
35 // NULL here. Constructing a TestingProfile can take over a 100ms, so this 35 // NULL here. Constructing a TestingProfile can take over a 100ms, so this
36 // optimization can be the difference between 'tests run with a noticeable 36 // optimization can be the difference between 'tests run with a noticeable
37 // delay' and 'tests run instantaneously'. 37 // delay' and 'tests run instantaneously'.
38 synced_device_tracker_->Start(NULL, user_share()); 38 synced_device_tracker_->Start(NULL, user_share());
39 } 39 }
40 40
41 void TearDown() { 41 virtual void TearDown() {
42 synced_device_tracker_.reset(); 42 synced_device_tracker_.reset();
43 test_user_share_.TearDown(); 43 test_user_share_.TearDown();
44 } 44 }
45 45
46 syncer::UserShare* user_share() { 46 syncer::UserShare* user_share() {
47 return test_user_share_.user_share(); 47 return test_user_share_.user_share();
48 } 48 }
49 49
50 // Expose the private method to our tests. 50 // Expose the private method to our tests.
51 void WriteLocalDeviceInfo(const DeviceInfo& info) { 51 void WriteLocalDeviceInfo(const DeviceInfo& info) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 EXPECT_TRUE(result_device_info->Equals(device_info_v2)); 148 EXPECT_TRUE(result_device_info->Equals(device_info_v2));
149 149
150 // The update write should have sent a nudge. 150 // The update write should have sent a nudge.
151 EXPECT_EQ(1, GetObservedChangesCounter()); 151 EXPECT_EQ(1, GetObservedChangesCounter());
152 } 152 }
153 153
154 } // namespace 154 } // namespace
155 155
156 } // namespace browser_sync 156 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698