| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 " \"version\": \"0\"," | 85 " \"version\": \"0\"," |
| 86 " \"app\": { \"background\": { \"scripts\": [\"main.js\"] }}," | 86 " \"app\": { \"background\": { \"scripts\": [\"main.js\"] }}," |
| 87 " \"file_handlers\": {" | 87 " \"file_handlers\": {" |
| 88 " \"text\": {" | 88 " \"text\": {" |
| 89 " \"extensions\": [ \"txt\" ]," | 89 " \"extensions\": [ \"txt\" ]," |
| 90 " \"title\": \"Text\"" | 90 " \"title\": \"Text\"" |
| 91 " }" | 91 " }" |
| 92 " }" | 92 " }" |
| 93 "}"; | 93 "}"; |
| 94 JSONStringValueDeserializer json_string_deserializer(json_manifest); | 94 JSONStringValueDeserializer json_string_deserializer(json_manifest); |
| 95 scoped_ptr<base::Value> manifest( | 95 scoped_ptr<base::Value> manifest = |
| 96 json_string_deserializer.Deserialize(&error_code, &error)); | 96 json_string_deserializer.Deserialize(&error_code, &error); |
| 97 base::DictionaryValue* manifest_dictionary; | 97 base::DictionaryValue* manifest_dictionary; |
| 98 | 98 |
| 99 manifest->GetAsDictionary(&manifest_dictionary); | 99 manifest->GetAsDictionary(&manifest_dictionary); |
| 100 ASSERT_TRUE(manifest_dictionary); | 100 ASSERT_TRUE(manifest_dictionary); |
| 101 | 101 |
| 102 scoped_refptr<extensions::Extension> extension = | 102 scoped_refptr<extensions::Extension> extension = |
| 103 extensions::Extension::Create( | 103 extensions::Extension::Create( |
| 104 test_directory.AppendASCII("invalid-extension"), | 104 test_directory.AppendASCII("invalid-extension"), |
| 105 extensions::Manifest::INVALID_LOCATION, *manifest_dictionary, | 105 extensions::Manifest::INVALID_LOCATION, *manifest_dictionary, |
| 106 extensions::Extension::NO_FLAGS, &error); | 106 extensions::Extension::NO_FLAGS, &error); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 TEST_F(PlatformUtilPosixTest, OpenFolderWithPosixSymlinks) { | 283 TEST_F(PlatformUtilPosixTest, OpenFolderWithPosixSymlinks) { |
| 284 EXPECT_EQ(OPEN_SUCCEEDED, CallOpenItem(symlink_to_folder_, OPEN_FOLDER)); | 284 EXPECT_EQ(OPEN_SUCCEEDED, CallOpenItem(symlink_to_folder_, OPEN_FOLDER)); |
| 285 EXPECT_EQ(OPEN_FAILED_INVALID_TYPE, | 285 EXPECT_EQ(OPEN_FAILED_INVALID_TYPE, |
| 286 CallOpenItem(symlink_to_file_, OPEN_FOLDER)); | 286 CallOpenItem(symlink_to_file_, OPEN_FOLDER)); |
| 287 EXPECT_EQ(OPEN_FAILED_PATH_NOT_FOUND, | 287 EXPECT_EQ(OPEN_FAILED_PATH_NOT_FOUND, |
| 288 CallOpenItem(symlink_to_nowhere_, OPEN_FOLDER)); | 288 CallOpenItem(symlink_to_nowhere_, OPEN_FOLDER)); |
| 289 } | 289 } |
| 290 #endif // OS_POSIX && !OS_CHROMEOS | 290 #endif // OS_POSIX && !OS_CHROMEOS |
| 291 | 291 |
| 292 } // namespace platform_util | 292 } // namespace platform_util |
| OLD | NEW |