| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 SetupProfile(test->verifier()); | 56 SetupProfile(test->verifier()); |
| 57 | 57 |
| 58 setup_completed_ = true; | 58 setup_completed_ = true; |
| 59 } | 59 } |
| 60 | 60 |
| 61 std::string SyncExtensionHelper::InstallExtension( | 61 std::string SyncExtensionHelper::InstallExtension( |
| 62 Profile* profile, const std::string& name, Manifest::Type type) { | 62 Profile* profile, const std::string& name, Manifest::Type type) { |
| 63 scoped_refptr<Extension> extension = GetExtension(profile, name, type); | 63 scoped_refptr<Extension> extension = GetExtension(profile, name, type); |
| 64 if (!extension.get()) { | 64 if (!extension.get()) { |
| 65 NOTREACHED() << "Could not install extension " << name; | 65 NOTREACHED() << "Could not install extension " << name; |
| 66 return ""; | 66 return std::string(); |
| 67 } | 67 } |
| 68 profile->GetExtensionService()->OnExtensionInstalled( | 68 profile->GetExtensionService()->OnExtensionInstalled( |
| 69 extension, syncer::StringOrdinal(), false /* no requirement errors */, | 69 extension, syncer::StringOrdinal(), false /* no requirement errors */, |
| 70 false /* don't wait for idle to install */); | 70 false /* don't wait for idle to install */); |
| 71 return extension->id(); | 71 return extension->id(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void SyncExtensionHelper::UninstallExtension( | 74 void SyncExtensionHelper::UninstallExtension( |
| 75 Profile* profile, const std::string& name) { | 75 Profile* profile, const std::string& name) { |
| 76 ExtensionService::UninstallExtensionHelper( | 76 ExtensionService::UninstallExtensionHelper( |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 EXPECT_EQ(expected_id, extension->id()); | 366 EXPECT_EQ(expected_id, extension->id()); |
| 367 return NULL; | 367 return NULL; |
| 368 } | 368 } |
| 369 DVLOG(2) << "created extension with name = " | 369 DVLOG(2) << "created extension with name = " |
| 370 << name << ", id = " << expected_id; | 370 << name << ", id = " << expected_id; |
| 371 (it->second)[name] = extension; | 371 (it->second)[name] = extension; |
| 372 id_to_name_[expected_id] = name; | 372 id_to_name_[expected_id] = name; |
| 373 id_to_type_[expected_id] = type; | 373 id_to_type_[expected_id] = type; |
| 374 return extension; | 374 return extension; |
| 375 } | 375 } |
| OLD | NEW |