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

Side by Side Diff: chrome/browser/sync/test/integration/enable_disable_test.cc

Issue 302173004: sync: Specialize functions that fetch type root (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/GET_BY_SERVER_TAG_DEPRECATED/GET_BY_SERVER_TAG/ Created 6 years, 6 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 "chrome/browser/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" 6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
7 #include "chrome/browser/sync/test/integration/sync_test.h" 7 #include "chrome/browser/sync/test/integration/sync_test.h"
8 #include "sync/internal_api/public/base/model_type.h" 8 #include "sync/internal_api/public/base/model_type.h"
9 #include "sync/internal_api/public/read_node.h" 9 #include "sync/internal_api/public/read_node.h"
10 #include "sync/internal_api/public/read_transaction.h" 10 #include "sync/internal_api/public/read_transaction.h"
(...skipping 10 matching lines...) Expand all
21 EnableDisableSingleClientTest() : SyncTest(SINGLE_CLIENT_LEGACY) {} 21 EnableDisableSingleClientTest() : SyncTest(SINGLE_CLIENT_LEGACY) {}
22 virtual ~EnableDisableSingleClientTest() {} 22 virtual ~EnableDisableSingleClientTest() {}
23 private: 23 private:
24 DISALLOW_COPY_AND_ASSIGN(EnableDisableSingleClientTest); 24 DISALLOW_COPY_AND_ASSIGN(EnableDisableSingleClientTest);
25 }; 25 };
26 26
27 bool DoesTopLevelNodeExist(syncer::UserShare* user_share, 27 bool DoesTopLevelNodeExist(syncer::UserShare* user_share,
28 syncer::ModelType type) { 28 syncer::ModelType type) {
29 syncer::ReadTransaction trans(FROM_HERE, user_share); 29 syncer::ReadTransaction trans(FROM_HERE, user_share);
30 syncer::ReadNode node(&trans); 30 syncer::ReadNode node(&trans);
31 return node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) == 31 return node.InitTypeRoot(type) == syncer::BaseNode::INIT_OK;
32 syncer::BaseNode::INIT_OK;
33 } 32 }
34 33
35 IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) { 34 IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) {
36 ASSERT_TRUE(SetupClients()); 35 ASSERT_TRUE(SetupClients());
37 36
38 // Setup sync with no enabled types. 37 // Setup sync with no enabled types.
39 ASSERT_TRUE(GetClient(0)->SetupSync(syncer::ModelTypeSet())); 38 ASSERT_TRUE(GetClient(0)->SetupSync(syncer::ModelTypeSet()));
40 39
41 // TODO(rlarocque, 97780): It should be possible to disable notifications 40 // TODO(rlarocque, 97780): It should be possible to disable notifications
42 // before calling SetupSync(). We should move this line back to the top 41 // before calling SetupSync(). We should move this line back to the top
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } else if (it.Get() == syncer::PREFERENCES) { 149 } else if (it.Get() == syncer::PREFERENCES) {
151 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, 150 ASSERT_FALSE(DoesTopLevelNodeExist(user_share,
152 syncer::PRIORITY_PREFERENCES)); 151 syncer::PRIORITY_PREFERENCES));
153 } 152 }
154 } 153 }
155 154
156 EnableNotifications(); 155 EnableNotifications();
157 } 156 }
158 157
159 } // namespace 158 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_typed_url_unittest.cc ('k') | components/sync_driver/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698