| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 JSONFileValueSerializer serializer(path); | 40 JSONFileValueSerializer serializer(path); |
| 41 std::string error; | 41 std::string error; |
| 42 scoped_ptr<Value> result(serializer.Deserialize(NULL, &error)); | 42 scoped_ptr<Value> result(serializer.Deserialize(NULL, &error)); |
| 43 if (!result.get()) { | 43 if (!result.get()) { |
| 44 EXPECT_EQ("", error); | 44 EXPECT_EQ("", error); |
| 45 return NULL; | 45 return NULL; |
| 46 } | 46 } |
| 47 | 47 |
| 48 scoped_refptr<Extension> extension = Extension::Create( | 48 scoped_refptr<Extension> extension = Extension::Create( |
| 49 path.DirName(), Extension::INVALID, | 49 path.DirName(), Manifest::INVALID_LOCATION, |
| 50 *static_cast<DictionaryValue*>(result.get()), extra_flags, &error); | 50 *static_cast<DictionaryValue*>(result.get()), extra_flags, &error); |
| 51 EXPECT_TRUE(extension) << error; | 51 EXPECT_TRUE(extension) << error; |
| 52 return extension; | 52 return extension; |
| 53 } | 53 } |
| 54 | 54 |
| 55 scoped_refptr<Extension> LoadManifest(const std::string& dir, | 55 scoped_refptr<Extension> LoadManifest(const std::string& dir, |
| 56 const std::string& test_file) { | 56 const std::string& test_file) { |
| 57 return LoadManifest(dir, test_file, Extension::NO_FLAGS); | 57 return LoadManifest(dir, test_file, Extension::NO_FLAGS); |
| 58 } | 58 } |
| 59 | 59 |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 apis.insert(APIPermission::kWebRequest); | 1361 apis.insert(APIPermission::kWebRequest); |
| 1362 apis.insert(APIPermission::kFileBrowserHandler); | 1362 apis.insert(APIPermission::kFileBrowserHandler); |
| 1363 EXPECT_EQ(2U, apis.size()); | 1363 EXPECT_EQ(2U, apis.size()); |
| 1364 | 1364 |
| 1365 scoped_refptr<PermissionSet> perm_set; | 1365 scoped_refptr<PermissionSet> perm_set; |
| 1366 perm_set = new PermissionSet(apis, empty_extent, empty_extent); | 1366 perm_set = new PermissionSet(apis, empty_extent, empty_extent); |
| 1367 EXPECT_EQ(4U, perm_set->apis().size()); | 1367 EXPECT_EQ(4U, perm_set->apis().size()); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 } // namespace extensions | 1370 } // namespace extensions |
| OLD | NEW |