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

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

Issue 10152003: sync: Make BaseNode lookup-related Init functions return specific failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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/test/integration/sync_test.h" 5 #include "chrome/browser/sync/test/integration/sync_test.h"
6 6
7 #include "chrome/browser/sync/internal_api/read_node.h" 7 #include "chrome/browser/sync/internal_api/read_node.h"
8 #include "chrome/browser/sync/internal_api/read_transaction.h" 8 #include "chrome/browser/sync/internal_api/read_transaction.h"
9 #include "chrome/browser/sync/profile_sync_service_harness.h" 9 #include "chrome/browser/sync/profile_sync_service_harness.h"
10 #include "sync/syncable/model_type.h" 10 #include "sync/syncable/model_type.h"
(...skipping 16 matching lines...) Expand all
27 EnableDisableSingleClientTest() : EnableDisableTest(SINGLE_CLIENT) {} 27 EnableDisableSingleClientTest() : EnableDisableTest(SINGLE_CLIENT) {}
28 virtual ~EnableDisableSingleClientTest() {} 28 virtual ~EnableDisableSingleClientTest() {}
29 private: 29 private:
30 DISALLOW_COPY_AND_ASSIGN(EnableDisableSingleClientTest); 30 DISALLOW_COPY_AND_ASSIGN(EnableDisableSingleClientTest);
31 }; 31 };
32 32
33 bool DoesTopLevelNodeExist(sync_api::UserShare* user_share, 33 bool DoesTopLevelNodeExist(sync_api::UserShare* user_share,
34 syncable::ModelType type) { 34 syncable::ModelType type) {
35 sync_api::ReadTransaction trans(FROM_HERE, user_share); 35 sync_api::ReadTransaction trans(FROM_HERE, user_share);
36 sync_api::ReadNode node(&trans); 36 sync_api::ReadNode node(&trans);
37 return node.InitByTagLookup(syncable::ModelTypeToRootTag(type)); 37 return node.InitByTagLookup(syncable::ModelTypeToRootTag(type)) ==
38 sync_api::BaseNode::INIT_OK;
38 } 39 }
39 40
40 IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) { 41 IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) {
41 ASSERT_TRUE(SetupClients()); 42 ASSERT_TRUE(SetupClients());
42 43
43 // Setup sync with no enabled types. 44 // Setup sync with no enabled types.
44 ASSERT_TRUE(GetClient(0)->SetupSync(syncable::ModelTypeSet())); 45 ASSERT_TRUE(GetClient(0)->SetupSync(syncable::ModelTypeSet()));
45 46
46 // TODO(rlarocque, 97780): It should be possible to disable notifications 47 // TODO(rlarocque, 97780): It should be possible to disable notifications
47 // before calling SetupSync(). We should move this line back to the top 48 // before calling SetupSync(). We should move this line back to the top
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (it.Get() == syncable::AUTOFILL) { 115 if (it.Get() == syncable::AUTOFILL) {
115 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, 116 ASSERT_FALSE(DoesTopLevelNodeExist(user_share,
116 syncable::AUTOFILL_PROFILE)); 117 syncable::AUTOFILL_PROFILE));
117 } 118 }
118 } 119 }
119 120
120 EnableNotifications(); 121 EnableNotifications();
121 } 122 }
122 123
123 } // namespace 124 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698