| 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/test/integration/sync_extension_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/extensions/extension_system_factory.h" | |
| 14 #include "chrome/browser/extensions/pending_extension_info.h" | 13 #include "chrome/browser/extensions/pending_extension_info.h" |
| 15 #include "chrome/browser/extensions/pending_extension_manager.h" | 14 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
| 18 #include "chrome/common/extensions/extension_manifest_constants.h" | 17 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 19 #include "chrome/common/string_ordinal.h" | 18 #include "chrome/common/string_ordinal.h" |
| 20 #include "chrome/browser/sync/test/integration/sync_test.h" | 19 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 21 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 20 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 22 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 << " do not match profile " << profile2->GetDebugName(); | 233 << " do not match profile " << profile2->GetDebugName(); |
| 235 return false; | 234 return false; |
| 236 } | 235 } |
| 237 ++it1; | 236 ++it1; |
| 238 ++it2; | 237 ++it2; |
| 239 } | 238 } |
| 240 return true; | 239 return true; |
| 241 } | 240 } |
| 242 | 241 |
| 243 void SyncExtensionHelper::SetupProfile(Profile* profile) { | 242 void SyncExtensionHelper::SetupProfile(Profile* profile) { |
| 244 ExtensionSystemFactory::GetForProfile(profile)->Init(true); | 243 ExtensionSystem::Get(profile)->Init(true); |
| 245 profile_extensions_.insert(make_pair(profile, ExtensionNameMap())); | 244 profile_extensions_.insert(make_pair(profile, ExtensionNameMap())); |
| 246 } | 245 } |
| 247 | 246 |
| 248 namespace { | 247 namespace { |
| 249 | 248 |
| 250 std::string NameToPublicKey(const std::string& name) { | 249 std::string NameToPublicKey(const std::string& name) { |
| 251 std::string public_key; | 250 std::string public_key; |
| 252 std::string pem; | 251 std::string pem; |
| 253 EXPECT_TRUE(Extension::ProducePEM(name, &pem) && | 252 EXPECT_TRUE(Extension::ProducePEM(name, &pem) && |
| 254 Extension::FormatPEMForFileOutput(pem, &public_key, | 253 Extension::FormatPEMForFileOutput(pem, &public_key, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 if (extension->id() != expected_id) { | 344 if (extension->id() != expected_id) { |
| 346 EXPECT_EQ(expected_id, extension->id()); | 345 EXPECT_EQ(expected_id, extension->id()); |
| 347 return NULL; | 346 return NULL; |
| 348 } | 347 } |
| 349 DVLOG(2) << "created extension with name = " | 348 DVLOG(2) << "created extension with name = " |
| 350 << name << ", id = " << expected_id; | 349 << name << ", id = " << expected_id; |
| 351 (it->second)[name] = extension; | 350 (it->second)[name] = extension; |
| 352 id_to_name_[expected_id] = name; | 351 id_to_name_[expected_id] = name; |
| 353 return extension; | 352 return extension; |
| 354 } | 353 } |
| OLD | NEW |