| 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" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 break; | 275 break; |
| 276 case Extension::TYPE_THEME: | 276 case Extension::TYPE_THEME: |
| 277 source.Set(extension_manifest_keys::kTheme, new DictionaryValue()); | 277 source.Set(extension_manifest_keys::kTheme, new DictionaryValue()); |
| 278 break; | 278 break; |
| 279 case Extension::TYPE_HOSTED_APP: | 279 case Extension::TYPE_HOSTED_APP: |
| 280 case Extension::TYPE_LEGACY_PACKAGED_APP: | 280 case Extension::TYPE_LEGACY_PACKAGED_APP: |
| 281 source.Set(extension_manifest_keys::kApp, new DictionaryValue()); | 281 source.Set(extension_manifest_keys::kApp, new DictionaryValue()); |
| 282 source.SetString(extension_manifest_keys::kLaunchWebURL, | 282 source.SetString(extension_manifest_keys::kLaunchWebURL, |
| 283 "http://www.example.com"); | 283 "http://www.example.com"); |
| 284 break; | 284 break; |
| 285 case Extension::TYPE_PLATFORM_APP: { |
| 286 source.Set(extension_manifest_keys::kApp, new DictionaryValue()); |
| 287 source.Set(extension_manifest_keys::kPlatformAppBackground, |
| 288 new DictionaryValue()); |
| 289 ListValue* scripts = new ListValue(); |
| 290 scripts->AppendString("main.js"); |
| 291 source.Set(extension_manifest_keys::kPlatformAppBackgroundScripts, |
| 292 scripts); |
| 293 break; |
| 294 } |
| 285 default: | 295 default: |
| 286 ADD_FAILURE(); | 296 ADD_FAILURE(); |
| 287 return NULL; | 297 return NULL; |
| 288 } | 298 } |
| 289 const FilePath sub_dir = FilePath().AppendASCII(name); | 299 const FilePath sub_dir = FilePath().AppendASCII(name); |
| 290 FilePath extension_dir; | 300 FilePath extension_dir; |
| 291 if (!file_util::PathExists(base_dir) && | 301 if (!file_util::PathExists(base_dir) && |
| 292 !file_util::CreateDirectory(base_dir) && | 302 !file_util::CreateDirectory(base_dir) && |
| 293 !file_util::CreateTemporaryDirInDir( | 303 !file_util::CreateTemporaryDirInDir( |
| 294 base_dir, sub_dir.value(), &extension_dir)) { | 304 base_dir, sub_dir.value(), &extension_dir)) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 if (extension->id() != expected_id) { | 358 if (extension->id() != expected_id) { |
| 349 EXPECT_EQ(expected_id, extension->id()); | 359 EXPECT_EQ(expected_id, extension->id()); |
| 350 return NULL; | 360 return NULL; |
| 351 } | 361 } |
| 352 DVLOG(2) << "created extension with name = " | 362 DVLOG(2) << "created extension with name = " |
| 353 << name << ", id = " << expected_id; | 363 << name << ", id = " << expected_id; |
| 354 (it->second)[name] = extension; | 364 (it->second)[name] = extension; |
| 355 id_to_name_[expected_id] = name; | 365 id_to_name_[expected_id] = name; |
| 356 return extension; | 366 return extension; |
| 357 } | 367 } |
| OLD | NEW |