| 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/extension_sync_data.h" | 5 #include "chrome/browser/extensions/extension_sync_data.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // the same result, but don't know that it's right). | 104 // the same result, but don't know that it's right). |
| 105 ExtensionSyncData extension_sync_data; | 105 ExtensionSyncData extension_sync_data; |
| 106 extension_sync_data.PopulateFromExtensionSpecifics(*extension_specifics); | 106 extension_sync_data.PopulateFromExtensionSpecifics(*extension_specifics); |
| 107 EXPECT_EQ(kValidId, extension_sync_data.id()); | 107 EXPECT_EQ(kValidId, extension_sync_data.id()); |
| 108 EXPECT_EQ(GURL(kValidUpdateUrl), extension_sync_data.update_url()); | 108 EXPECT_EQ(GURL(kValidUpdateUrl), extension_sync_data.update_url()); |
| 109 EXPECT_FALSE(extension_sync_data.enabled()); | 109 EXPECT_FALSE(extension_sync_data.enabled()); |
| 110 EXPECT_EQ(true, extension_sync_data.incognito_enabled()); | 110 EXPECT_EQ(true, extension_sync_data.incognito_enabled()); |
| 111 EXPECT_FALSE(extension_sync_data.remote_install()); | 111 EXPECT_FALSE(extension_sync_data.remote_install()); |
| 112 EXPECT_EQ(ExtensionSyncData::BOOLEAN_TRUE, | 112 EXPECT_EQ(ExtensionSyncData::BOOLEAN_TRUE, |
| 113 extension_sync_data.all_urls_enabled()); | 113 extension_sync_data.all_urls_enabled()); |
| 114 EXPECT_EQ(Version(kVersion), extension_sync_data.version()); | 114 EXPECT_EQ(base::Version(kVersion), extension_sync_data.version()); |
| 115 EXPECT_EQ(std::string(kName), extension_sync_data.name()); | 115 EXPECT_EQ(std::string(kName), extension_sync_data.name()); |
| 116 | 116 |
| 117 // Check the serialize-deserialize process for ExtensionSyncData to proto. | 117 // Check the serialize-deserialize process for ExtensionSyncData to proto. |
| 118 SyncDataToProtobufEqual(extension_sync_data); | 118 SyncDataToProtobufEqual(extension_sync_data); |
| 119 | 119 |
| 120 // The most important thing to test is the "all urls" bit, since it is a | 120 // The most important thing to test is the "all urls" bit, since it is a |
| 121 // tri-state boolean (and thus has more logic). Also flip another bit for a | 121 // tri-state boolean (and thus has more logic). Also flip another bit for a |
| 122 // sanity check. | 122 // sanity check. |
| 123 extension_specifics->set_all_urls_enabled(false); | 123 extension_specifics->set_all_urls_enabled(false); |
| 124 extension_specifics->set_incognito_enabled(false); | 124 extension_specifics->set_incognito_enabled(false); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 syncer::SyncData::CreateLocalData("sync_tag", "non_unique_title", entity); | 222 syncer::SyncData::CreateLocalData("sync_tag", "non_unique_title", entity); |
| 223 | 223 |
| 224 // There should be no issue loading the sync data. | 224 // There should be no issue loading the sync data. |
| 225 std::unique_ptr<ExtensionSyncData> app_sync_data = | 225 std::unique_ptr<ExtensionSyncData> app_sync_data = |
| 226 ExtensionSyncData::CreateFromSyncData(sync_data); | 226 ExtensionSyncData::CreateFromSyncData(sync_data); |
| 227 ASSERT_TRUE(app_sync_data.get()); | 227 ASSERT_TRUE(app_sync_data.get()); |
| 228 app_sync_data->GetSyncData(); | 228 app_sync_data->GetSyncData(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace extensions | 231 } // namespace extensions |
| OLD | NEW |