| 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 20 matching lines...) Expand all Loading... |
| 31 #if defined(ARCH_CPU_X86) | 31 #if defined(ARCH_CPU_X86) |
| 32 FILE_PATH_LITERAL("components/flapper/linux"); | 32 FILE_PATH_LITERAL("components/flapper/linux"); |
| 33 #elif defined(ARCH_CPU_X86_64) | 33 #elif defined(ARCH_CPU_X86_64) |
| 34 FILE_PATH_LITERAL("components/flapper/linux_x64"); | 34 FILE_PATH_LITERAL("components/flapper/linux_x64"); |
| 35 #else | 35 #else |
| 36 FILE_PATH_LITERAL("components/flapper/NONEXISTENT"); | 36 FILE_PATH_LITERAL("components/flapper/NONEXISTENT"); |
| 37 #endif | 37 #endif |
| 38 #endif | 38 #endif |
| 39 } | 39 } |
| 40 | 40 |
| 41 // TODO(jschuh): Get Pepper Flash supported on Win64 build. crbug.com/179716 |
| 42 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 43 #define MAYBE_PepperFlashCheck DISABLED_PepperFlashCheck |
| 44 #else |
| 45 #define MAYBE_PepperFlashCheck PepperFlashCheck |
| 46 #endif |
| 47 |
| 41 // TODO(viettrungluu): Separate out into two separate tests; use a test fixture. | 48 // TODO(viettrungluu): Separate out into two separate tests; use a test fixture. |
| 42 TEST(ComponentInstallerTest, PepperFlashCheck) { | 49 TEST(ComponentInstallerTest, MAYBE_PepperFlashCheck) { |
| 43 MessageLoop message_loop; | 50 MessageLoop message_loop; |
| 44 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); | 51 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); |
| 45 | 52 |
| 46 ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test; | 53 ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test; |
| 47 ppapi::TestGlobals test_globals(per_thread_for_test); | 54 ppapi::TestGlobals test_globals(per_thread_for_test); |
| 48 ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals); | 55 ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals); |
| 49 | 56 |
| 50 // The test directory is chrome/test/data/components/flapper. | 57 // The test directory is chrome/test/data/components/flapper. |
| 51 base::FilePath manifest; | 58 base::FilePath manifest; |
| 52 PathService::Get(chrome::DIR_TEST_DATA, &manifest); | 59 PathService::Get(chrome::DIR_TEST_DATA, &manifest); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 scoped_ptr<base::Value> root(serializer.Deserialize(NULL, &error)); | 70 scoped_ptr<base::Value> root(serializer.Deserialize(NULL, &error)); |
| 64 ASSERT_TRUE(root.get() != NULL); | 71 ASSERT_TRUE(root.get() != NULL); |
| 65 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); | 72 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); |
| 66 | 73 |
| 67 // This checks that the whole manifest is compatible. | 74 // This checks that the whole manifest is compatible. |
| 68 Version version; | 75 Version version; |
| 69 EXPECT_TRUE(CheckPepperFlashManifest( | 76 EXPECT_TRUE(CheckPepperFlashManifest( |
| 70 static_cast<base::DictionaryValue*>(root.get()), &version)); | 77 static_cast<base::DictionaryValue*>(root.get()), &version)); |
| 71 EXPECT_TRUE(version.IsValid()); | 78 EXPECT_TRUE(version.IsValid()); |
| 72 } | 79 } |
| OLD | NEW |