Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4952)

Unified Diff: chrome/browser/component_updater/test/component_installers_unittest.cc

Issue 1102103002: Move the unit tests files side-by-side with the corresponding .cc files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/test/component_installers_unittest.cc
diff --git a/chrome/browser/component_updater/test/component_installers_unittest.cc b/chrome/browser/component_updater/test/component_installers_unittest.cc
deleted file mode 100644
index 8cb58d0c6f2db693cf27dea264eb4378738e4a4d..0000000000000000000000000000000000000000
--- a/chrome/browser/component_updater/test/component_installers_unittest.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/component_updater/flash_component_installer.h"
-
-#include "base/files/file_path.h"
-#include "base/files/file_util.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 "chrome/common/pepper_flash.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 {
-// File name of the Pepper Flash plugin on different platforms.
-const base::FilePath::CharType kDataPath[] =
-#if defined(OS_MACOSX)
-#if defined(ARCH_CPU_X86)
- FILE_PATH_LITERAL("components/flapper/mac");
-#elif defined(ARCH_CPU_X86_64)
- FILE_PATH_LITERAL("components/flapper/mac_x64");
-#else
- FILE_PATH_LITERAL("components/flapper/NONEXISTENT");
-#endif
-#elif defined(OS_WIN)
-#if defined(ARCH_CPU_X86)
- FILE_PATH_LITERAL("components\\flapper\\windows");
-#elif defined(ARCH_CPU_X86_64)
- FILE_PATH_LITERAL("components\\flapper\\windows_x64");
-#else
- FILE_PATH_LITERAL("components\\flapper\\NONEXISTENT");
-#endif
-#else // OS_LINUX, etc.
-#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
-} // namespace
-
-// TODO(viettrungluu): Separate out into two separate tests; use a test fixture.
-TEST(ComponentInstallerTest, 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);
-
- // The test directory is chrome/test/data/components/flapper.
- 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;
- }
-
- JSONFileValueDeserializer deserializer(manifest);
- std::string error;
- scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>(
- deserializer.Deserialize(NULL, &error)));
- ASSERT_TRUE(root);
- ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY));
-
- // This checks that the whole manifest is compatible.
- Version version;
- EXPECT_TRUE(chrome::CheckPepperFlashManifest(*root, &version));
- EXPECT_TRUE(version.IsValid());
-}
-
-} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698