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