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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 scripts); | 301 scripts); |
302 break; | 302 break; |
303 } | 303 } |
304 default: | 304 default: |
305 ADD_FAILURE(); | 305 ADD_FAILURE(); |
306 return NULL; | 306 return NULL; |
307 } | 307 } |
308 const base::FilePath sub_dir = base::FilePath().AppendASCII(name); | 308 const base::FilePath sub_dir = base::FilePath().AppendASCII(name); |
309 base::FilePath extension_dir; | 309 base::FilePath extension_dir; |
310 if (!base::PathExists(base_dir) && | 310 if (!base::PathExists(base_dir) && |
311 !file_util::CreateDirectory(base_dir)) { | 311 !base::CreateDirectory(base_dir)) { |
312 ADD_FAILURE(); | 312 ADD_FAILURE(); |
313 return NULL; | 313 return NULL; |
314 } | 314 } |
315 if (!base::CreateTemporaryDirInDir(base_dir, sub_dir.value(), | 315 if (!base::CreateTemporaryDirInDir(base_dir, sub_dir.value(), |
316 &extension_dir)) { | 316 &extension_dir)) { |
317 ADD_FAILURE(); | 317 ADD_FAILURE(); |
318 return NULL; | 318 return NULL; |
319 } | 319 } |
320 std::string error; | 320 std::string error; |
321 scoped_refptr<Extension> extension = | 321 scoped_refptr<Extension> extension = |
(...skipping 48 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 |