| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |