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/extensions/app_sync_data.h" | 5 #include "chrome/browser/extensions/app_sync_data.h" |
6 | 6 |
7 #include "sync/api/string_ordinal.h" | 7 #include "sync/api/string_ordinal.h" |
8 #include "sync/protocol/app_specifics.pb.h" | 8 #include "sync/protocol/app_specifics.pb.h" |
9 #include "sync/protocol/sync.pb.h" | 9 #include "sync/protocol/sync.pb.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 virtual ~AppSyncDataTest() {} | 22 virtual ~AppSyncDataTest() {} |
23 | 23 |
24 void SetRequiredExtensionValues( | 24 void SetRequiredExtensionValues( |
25 sync_pb::ExtensionSpecifics* extension_specifics) { | 25 sync_pb::ExtensionSpecifics* extension_specifics) { |
26 extension_specifics->set_id(kValidId); | 26 extension_specifics->set_id(kValidId); |
27 extension_specifics->set_update_url(kValidUpdateUrl); | 27 extension_specifics->set_update_url(kValidUpdateUrl); |
28 extension_specifics->set_version(kValidVersion); | 28 extension_specifics->set_version(kValidVersion); |
29 extension_specifics->set_enabled(false); | 29 extension_specifics->set_enabled(false); |
30 extension_specifics->set_incognito_enabled(true); | 30 extension_specifics->set_incognito_enabled(true); |
31 extension_specifics->set_remote_install(false); | 31 extension_specifics->set_remote_install(false); |
| 32 extension_specifics->set_installed_by_custodian(false); |
32 extension_specifics->set_name(kName); | 33 extension_specifics->set_name(kName); |
33 } | 34 } |
34 }; | 35 }; |
35 | 36 |
36 TEST_F(AppSyncDataTest, SyncDataToExtensionSyncDataForApp) { | 37 TEST_F(AppSyncDataTest, SyncDataToExtensionSyncDataForApp) { |
37 sync_pb::EntitySpecifics entity; | 38 sync_pb::EntitySpecifics entity; |
38 sync_pb::AppSpecifics* app_specifics = entity.mutable_app(); | 39 sync_pb::AppSpecifics* app_specifics = entity.mutable_app(); |
39 app_specifics->set_app_launch_ordinal( | 40 app_specifics->set_app_launch_ordinal( |
40 syncer::StringOrdinal::CreateInitialOrdinal().ToInternalValue()); | 41 syncer::StringOrdinal::CreateInitialOrdinal().ToInternalValue()); |
41 app_specifics->set_page_ordinal( | 42 app_specifics->set_page_ordinal( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 90 |
90 syncer::SyncData sync_data = | 91 syncer::SyncData sync_data = |
91 syncer::SyncData::CreateLocalData("sync_tag", "non_unique_title", entity); | 92 syncer::SyncData::CreateLocalData("sync_tag", "non_unique_title", entity); |
92 | 93 |
93 // There should be no issue loading the sync data. | 94 // There should be no issue loading the sync data. |
94 AppSyncData app_sync_data(sync_data); | 95 AppSyncData app_sync_data(sync_data); |
95 app_sync_data.GetSyncData(); | 96 app_sync_data.GetSyncData(); |
96 } | 97 } |
97 | 98 |
98 } // namespace extensions | 99 } // namespace extensions |
OLD | NEW |