| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 source.Set(extension_manifest_keys::kPlatformAppBackgroundScripts, | 298 source.Set(extension_manifest_keys::kPlatformAppBackgroundScripts, |
| 299 scripts); | 299 scripts); |
| 300 break; | 300 break; |
| 301 } | 301 } |
| 302 default: | 302 default: |
| 303 ADD_FAILURE(); | 303 ADD_FAILURE(); |
| 304 return NULL; | 304 return NULL; |
| 305 } | 305 } |
| 306 const base::FilePath sub_dir = base::FilePath().AppendASCII(name); | 306 const base::FilePath sub_dir = base::FilePath().AppendASCII(name); |
| 307 base::FilePath extension_dir; | 307 base::FilePath extension_dir; |
| 308 if (!file_util::PathExists(base_dir) && | 308 if (!base::PathExists(base_dir) && |
| 309 !file_util::CreateDirectory(base_dir)) { | 309 !file_util::CreateDirectory(base_dir)) { |
| 310 ADD_FAILURE(); | 310 ADD_FAILURE(); |
| 311 return NULL; | 311 return NULL; |
| 312 } | 312 } |
| 313 if (!file_util::CreateTemporaryDirInDir( | 313 if (!file_util::CreateTemporaryDirInDir( |
| 314 base_dir, sub_dir.value(), &extension_dir)) { | 314 base_dir, sub_dir.value(), &extension_dir)) { |
| 315 ADD_FAILURE(); | 315 ADD_FAILURE(); |
| 316 return NULL; | 316 return NULL; |
| 317 } | 317 } |
| 318 std::string error; | 318 std::string error; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 EXPECT_EQ(expected_id, extension->id()); | 368 EXPECT_EQ(expected_id, extension->id()); |
| 369 return NULL; | 369 return NULL; |
| 370 } | 370 } |
| 371 DVLOG(2) << "created extension with name = " | 371 DVLOG(2) << "created extension with name = " |
| 372 << name << ", id = " << expected_id; | 372 << name << ", id = " << expected_id; |
| 373 (it->second)[name] = extension; | 373 (it->second)[name] = extension; |
| 374 id_to_name_[expected_id] = name; | 374 id_to_name_[expected_id] = name; |
| 375 id_to_type_[expected_id] = type; | 375 id_to_type_[expected_id] = type; |
| 376 return extension; | 376 return extension; |
| 377 } | 377 } |
| OLD | NEW |