This source file includes following definitions.
- TEST
#include "chrome/browser/component_updater/flash_component_installer.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/json/json_file_value_serializer.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/version.h"
#include "build/build_config.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/test/test_browser_thread.h"
#include "ppapi/shared_impl/test_globals.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
namespace component_updater {
namespace {
const base::FilePath::CharType kDataPath[] =
#if defined(OS_MACOSX)
FILE_PATH_LITERAL("components/flapper/mac");
#elif defined(OS_WIN)
FILE_PATH_LITERAL("components\\flapper\\windows");
#else
#if defined(ARCH_CPU_X86)
FILE_PATH_LITERAL("components/flapper/linux");
#elif defined(ARCH_CPU_X86_64)
FILE_PATH_LITERAL("components/flapper/linux_x64");
#else
FILE_PATH_LITERAL("components/flapper/NONEXISTENT");
#endif
#endif
}
#if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
#define MAYBE_PepperFlashCheck DISABLED_PepperFlashCheck
#elif defined(OS_MACOSX) && defined(ARCH_CPU_X86_64)
#define MAYBE_PepperFlashCheck DISABLED_PepperFlashCheck
#else
#define MAYBE_PepperFlashCheck PepperFlashCheck
#endif
TEST(ComponentInstallerTest, MAYBE_PepperFlashCheck) {
base::MessageLoop message_loop;
content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test;
ppapi::TestGlobals test_globals(per_thread_for_test);
ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals);
base::FilePath manifest;
PathService::Get(chrome::DIR_TEST_DATA, &manifest);
manifest = manifest.Append(kDataPath);
manifest = manifest.AppendASCII("manifest.json");
if (!base::PathExists(manifest)) {
LOG(WARNING) << "No test manifest available. Skipping.";
return;
}
JSONFileValueSerializer serializer(manifest);
std::string error;
scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>(
serializer.Deserialize(NULL, &error)));
ASSERT_TRUE(root);
ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY));
Version version;
EXPECT_TRUE(CheckPepperFlashManifest(*root, &version));
EXPECT_TRUE(version.IsValid());
}
}