Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3587)

Unified Diff: chrome/browser/sync/test/integration/sync_extension_helper.cc

Issue 11308072: Include v2 packaged apps in sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment explaining index Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/sync_extension_helper.cc
diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc
index a4ce6076fdf19927a0229c3ef539eb8721e2b725..1b0143adeb6e4a60ef102602bbaa43505a0c54ff 100644
--- a/chrome/browser/sync/test/integration/sync_extension_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc
@@ -140,8 +140,7 @@ bool SyncExtensionHelper::IsExtensionPendingInstallForSync(
return info->is_from_sync();
}
-void SyncExtensionHelper::InstallExtensionsPendingForSync(
- Profile* profile, Extension::Type type) {
+void SyncExtensionHelper::InstallExtensionsPendingForSync(Profile* profile) {
// TODO(akalin): Mock out the servers that the extensions auto-update
// mechanism talk to so as to more closely match what actually happens.
// Background networking will need to be re-enabled for extensions tests.
@@ -167,7 +166,12 @@ void SyncExtensionHelper::InstallExtensionsPendingForSync(
<< " (profile = " << profile->GetDebugName() << ")";
continue;
}
- InstallExtension(profile, iter2->second, type);
+ TypeMap::const_iterator iter3 = id_to_type_.find(*iter);
+ if (iter3 == id_to_type_.end()) {
+ ADD_FAILURE() << "Could not get type for id " << *iter
+ << " (profile = " << profile->GetDebugName() << ")";
+ }
+ InstallExtension(profile, iter2->second, iter3->second);
}
}
@@ -282,6 +286,16 @@ scoped_refptr<Extension> CreateExtension(
source.SetString(extension_manifest_keys::kLaunchWebURL,
"http://www.example.com");
break;
+ case Extension::TYPE_PLATFORM_APP: {
+ source.Set(extension_manifest_keys::kApp, new DictionaryValue());
+ source.Set(extension_manifest_keys::kPlatformAppBackground,
+ new DictionaryValue());
+ ListValue* scripts = new ListValue();
+ scripts->AppendString("main.js");
+ source.Set(extension_manifest_keys::kPlatformAppBackgroundScripts,
+ scripts);
+ break;
+ }
default:
ADD_FAILURE();
return NULL;
@@ -289,8 +303,11 @@ scoped_refptr<Extension> CreateExtension(
const FilePath sub_dir = FilePath().AppendASCII(name);
FilePath extension_dir;
if (!file_util::PathExists(base_dir) &&
- !file_util::CreateDirectory(base_dir) &&
- !file_util::CreateTemporaryDirInDir(
+ !file_util::CreateDirectory(base_dir)) {
+ ADD_FAILURE();
+ return NULL;
+ }
+ if (!file_util::CreateTemporaryDirInDir(
base_dir, sub_dir.value(), &extension_dir)) {
ADD_FAILURE();
return NULL;
@@ -353,5 +370,6 @@ scoped_refptr<Extension> SyncExtensionHelper::GetExtension(
<< name << ", id = " << expected_id;
(it->second)[name] = extension;
id_to_name_[expected_id] = name;
+ id_to_type_[expected_id] = type;
return extension;
}
« no previous file with comments | « chrome/browser/sync/test/integration/sync_extension_helper.h ('k') | chrome/browser/sync/test/integration/sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698