| 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/component_updater/flash_component_installer.h" | 5 #include "chrome/browser/component_updater/flash_component_installer.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 base::FilePath manifest; | 66 base::FilePath manifest; |
| 67 PathService::Get(chrome::DIR_TEST_DATA, &manifest); | 67 PathService::Get(chrome::DIR_TEST_DATA, &manifest); |
| 68 manifest = manifest.Append(kDataPath); | 68 manifest = manifest.Append(kDataPath); |
| 69 manifest = manifest.AppendASCII("manifest.json"); | 69 manifest = manifest.AppendASCII("manifest.json"); |
| 70 | 70 |
| 71 if (!base::PathExists(manifest)) { | 71 if (!base::PathExists(manifest)) { |
| 72 LOG(WARNING) << "No test manifest available. Skipping."; | 72 LOG(WARNING) << "No test manifest available. Skipping."; |
| 73 return; | 73 return; |
| 74 } | 74 } |
| 75 | 75 |
| 76 JSONFileValueSerializer serializer(manifest); | 76 JSONFileValueDeserializer deserializer(manifest); |
| 77 std::string error; | 77 std::string error; |
| 78 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( | 78 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( |
| 79 serializer.Deserialize(NULL, &error))); | 79 deserializer.Deserialize(NULL, &error))); |
| 80 ASSERT_TRUE(root); | 80 ASSERT_TRUE(root); |
| 81 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); | 81 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); |
| 82 | 82 |
| 83 // This checks that the whole manifest is compatible. | 83 // This checks that the whole manifest is compatible. |
| 84 Version version; | 84 Version version; |
| 85 EXPECT_TRUE(chrome::CheckPepperFlashManifest(*root, &version)); | 85 EXPECT_TRUE(chrome::CheckPepperFlashManifest(*root, &version)); |
| 86 EXPECT_TRUE(version.IsValid()); | 86 EXPECT_TRUE(version.IsValid()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace component_updater | 89 } // namespace component_updater |
| OLD | NEW |