| 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_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 << " do not match profile " << profile2->GetDebugName(); | 246 << " do not match profile " << profile2->GetDebugName(); |
| 247 return false; | 247 return false; |
| 248 } | 248 } |
| 249 ++it1; | 249 ++it1; |
| 250 ++it2; | 250 ++it2; |
| 251 } | 251 } |
| 252 return true; | 252 return true; |
| 253 } | 253 } |
| 254 | 254 |
| 255 void SyncExtensionHelper::SetupProfile(Profile* profile) { | 255 void SyncExtensionHelper::SetupProfile(Profile* profile) { |
| 256 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile(true, false); | 256 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile(true); |
| 257 profile_extensions_.insert(make_pair(profile, ExtensionNameMap())); | 257 profile_extensions_.insert(make_pair(profile, ExtensionNameMap())); |
| 258 } | 258 } |
| 259 | 259 |
| 260 namespace { | 260 namespace { |
| 261 | 261 |
| 262 std::string NameToPublicKey(const std::string& name) { | 262 std::string NameToPublicKey(const std::string& name) { |
| 263 std::string public_key; | 263 std::string public_key; |
| 264 std::string pem; | 264 std::string pem; |
| 265 EXPECT_TRUE(Extension::ProducePEM(name, &pem) && | 265 EXPECT_TRUE(Extension::ProducePEM(name, &pem) && |
| 266 Extension::FormatPEMForFileOutput(pem, &public_key, | 266 Extension::FormatPEMForFileOutput(pem, &public_key, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 EXPECT_EQ(expected_id, extension->id()); | 370 EXPECT_EQ(expected_id, extension->id()); |
| 371 return NULL; | 371 return NULL; |
| 372 } | 372 } |
| 373 DVLOG(2) << "created extension with name = " | 373 DVLOG(2) << "created extension with name = " |
| 374 << name << ", id = " << expected_id; | 374 << name << ", id = " << expected_id; |
| 375 (it->second)[name] = extension; | 375 (it->second)[name] = extension; |
| 376 id_to_name_[expected_id] = name; | 376 id_to_name_[expected_id] = name; |
| 377 id_to_type_[expected_id] = type; | 377 id_to_type_[expected_id] = type; |
| 378 return extension; | 378 return extension; |
| 379 } | 379 } |
| OLD | NEW |