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

Unified Diff: chrome/common/extensions/api/file_handlers/file_handlers_manifest_unittest.cc

Issue 280963002: Move FileHandlersInfo to /extensions and remove struct FileHandlersInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 6 years, 7 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/common/extensions/api/file_handlers/file_handlers_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/file_handlers/file_handlers_manifest_unittest.cc
diff --git a/chrome/common/extensions/api/file_handlers/file_handlers_manifest_unittest.cc b/chrome/common/extensions/api/file_handlers/file_handlers_manifest_unittest.cc
deleted file mode 100644
index 5e0cd3daef1ed9d614ef6033c23e4a6cf4b4ecce..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/api/file_handlers/file_handlers_manifest_unittest.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2013 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/common/extensions/api/file_handlers/file_handlers_parser.h"
-#include "chrome/common/extensions/extension_constants.h"
-#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
-//#include "extensions/common/error_utils.h"
-#include "extensions/common/manifest_constants.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace errors = extensions::manifest_errors;
-
-using extensions::Extension;
-using extensions::FileHandlers;
-using extensions::FileHandlerInfo;
-
-class FileHandlersManifestTest : public ExtensionManifestTest {
-};
-
-TEST_F(FileHandlersManifestTest, InvalidFileHandlers) {
- Testcase testcases[] = {
- Testcase("file_handlers_invalid_handlers.json",
- errors::kInvalidFileHandlers),
- Testcase("file_handlers_invalid_type.json",
- errors::kInvalidFileHandlerType),
- Testcase("file_handlers_invalid_extension.json",
- errors::kInvalidFileHandlerExtension),
- Testcase("file_handlers_invalid_no_type_or_extension.json",
- errors::kInvalidFileHandlerNoTypeOrExtension),
- Testcase("file_handlers_invalid_title.json",
- errors::kInvalidFileHandlerTitle),
- Testcase("file_handlers_invalid_type_element.json",
- errors::kInvalidFileHandlerTypeElement),
- Testcase("file_handlers_invalid_extension_element.json",
- errors::kInvalidFileHandlerExtensionElement),
- Testcase("file_handlers_invalid_too_many.json",
- errors::kInvalidFileHandlersTooManyTypesAndExtensions),
- };
- RunTestcases(testcases, arraysize(testcases), EXPECT_TYPE_ERROR);
-}
-
-TEST_F(FileHandlersManifestTest, ValidFileHandlers) {
- scoped_refptr<const Extension> extension =
- LoadAndExpectSuccess("file_handlers_valid.json");
-
- ASSERT_TRUE(extension.get());
- const std::vector<FileHandlerInfo>* handlers =
- FileHandlers::GetFileHandlers(extension.get());
- ASSERT_TRUE(handlers != NULL);
- ASSERT_EQ(2U, handlers->size());
-
- FileHandlerInfo handler = handlers->at(0);
- EXPECT_EQ("image", handler.id);
- EXPECT_EQ("Image editor", handler.title);
- EXPECT_EQ(1U, handler.types.size());
- EXPECT_EQ(1U, handler.types.count("image/*"));
- EXPECT_EQ(2U, handler.extensions.size());
- EXPECT_EQ(1U, handler.extensions.count(".png"));
- EXPECT_EQ(1U, handler.extensions.count(".gif"));
-
- handler = handlers->at(1);
- EXPECT_EQ("text", handler.id);
- EXPECT_EQ("Text editor", handler.title);
- EXPECT_EQ(1U, handler.types.size());
- EXPECT_EQ(1U, handler.types.count("text/*"));
- EXPECT_EQ(0U, handler.extensions.size());
-}
-
-TEST_F(FileHandlersManifestTest, NotPlatformApp) {
- // This should load successfully but have the file handlers ignored.
- scoped_refptr<const Extension> extension =
- LoadAndExpectSuccess("file_handlers_invalid_not_app.json");
-
- ASSERT_TRUE(extension.get());
- const std::vector<FileHandlerInfo>* handlers =
- FileHandlers::GetFileHandlers(extension.get());
- ASSERT_TRUE(handlers == NULL);
-}
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/common/extensions/api/file_handlers/file_handlers_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698