| 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/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/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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test; | 58 ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test; |
| 59 ppapi::TestGlobals test_globals(per_thread_for_test); | 59 ppapi::TestGlobals test_globals(per_thread_for_test); |
| 60 ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals); | 60 ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals); |
| 61 | 61 |
| 62 // The test directory is chrome/test/data/components/flapper. | 62 // The test directory is chrome/test/data/components/flapper. |
| 63 base::FilePath manifest; | 63 base::FilePath manifest; |
| 64 PathService::Get(chrome::DIR_TEST_DATA, &manifest); | 64 PathService::Get(chrome::DIR_TEST_DATA, &manifest); |
| 65 manifest = manifest.Append(kDataPath); | 65 manifest = manifest.Append(kDataPath); |
| 66 manifest = manifest.AppendASCII("manifest.json"); | 66 manifest = manifest.AppendASCII("manifest.json"); |
| 67 | 67 |
| 68 if (!file_util::PathExists(manifest)) { | 68 if (!base::PathExists(manifest)) { |
| 69 LOG(WARNING) << "No test manifest available. Skipping."; | 69 LOG(WARNING) << "No test manifest available. Skipping."; |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 JSONFileValueSerializer serializer(manifest); | 73 JSONFileValueSerializer serializer(manifest); |
| 74 std::string error; | 74 std::string error; |
| 75 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( | 75 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( |
| 76 serializer.Deserialize(NULL, &error))); | 76 serializer.Deserialize(NULL, &error))); |
| 77 ASSERT_TRUE(root); | 77 ASSERT_TRUE(root); |
| 78 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); | 78 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); |
| 79 | 79 |
| 80 // This checks that the whole manifest is compatible. | 80 // This checks that the whole manifest is compatible. |
| 81 Version version; | 81 Version version; |
| 82 EXPECT_TRUE(CheckPepperFlashManifest(*root, &version)); | 82 EXPECT_TRUE(CheckPepperFlashManifest(*root, &version)); |
| 83 EXPECT_TRUE(version.IsValid()); | 83 EXPECT_TRUE(version.IsValid()); |
| 84 } | 84 } |
| OLD | NEW |