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

Side by Side Diff: chrome/browser/extensions/api/streams_private/streams_private_manifest_unittest.cc

Issue 14694010: Consolidate manifest handler registration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/strings/string_number_conversions.h" 5 #include "base/strings/string_number_conversions.h"
6 #include "chrome/common/extensions/extension_builder.h" 6 #include "chrome/common/extensions/extension_builder.h"
7 #include "chrome/common/extensions/extension_manifest_constants.h" 7 #include "chrome/common/extensions/extension_manifest_constants.h"
8 #include "chrome/common/extensions/manifest_handler.h"
9 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" 8 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
10 #include "chrome/common/extensions/manifest_url_handler.h" 9 #include "chrome/common/extensions/manifest_url_handler.h"
11 #include "chrome/common/extensions/mime_types_handler.h" 10 #include "chrome/common/extensions/mime_types_handler.h"
12 #include "chrome/common/extensions/value_builder.h" 11 #include "chrome/common/extensions/value_builder.h"
13 #include "extensions/common/error_utils.h" 12 #include "extensions/common/error_utils.h"
14 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
15 14
16 namespace errors = extension_manifest_errors; 15 namespace errors = extension_manifest_errors;
17 16
18 using extensions::DictionaryBuilder; 17 using extensions::DictionaryBuilder;
19 using extensions::Extension; 18 using extensions::Extension;
20 using extensions::ExtensionBuilder; 19 using extensions::ExtensionBuilder;
21 using extensions::ListBuilder; 20 using extensions::ListBuilder;
22 21
23 namespace { 22 namespace {
24 23
25 class StreamsPrivateManifestTest : public ExtensionManifestTest { 24 class StreamsPrivateManifestTest : public ExtensionManifestTest {
26 virtual void SetUp() OVERRIDE {
27 ExtensionManifestTest::SetUp();
28 (new MimeTypesHandlerParser)->Register();
29 }
30 }; 25 };
31 26
32 TEST_F(StreamsPrivateManifestTest, ValidMimeTypesHandlerMIMETypes) { 27 TEST_F(StreamsPrivateManifestTest, ValidMimeTypesHandlerMIMETypes) {
33 scoped_refptr<const Extension> extension = 28 scoped_refptr<const Extension> extension =
34 ExtensionBuilder() 29 ExtensionBuilder()
35 .SetID(extension_misc::kQuickOfficeExtensionId) 30 .SetID(extension_misc::kQuickOfficeExtensionId)
36 .SetManifest(DictionaryBuilder() 31 .SetManifest(DictionaryBuilder()
37 .Set("name", "MIME type handler test") 32 .Set("name", "MIME type handler test")
38 .Set("version", "1.0.0") 33 .Set("version", "1.0.0")
39 .Set("manifest_version", 2) 34 .Set("manifest_version", 2)
(...skipping 21 matching lines...) Expand all
61 .Append("plain/text"))) 56 .Append("plain/text")))
62 .Build(); 57 .Build();
63 58
64 ASSERT_TRUE(extension.get()); 59 ASSERT_TRUE(extension.get());
65 60
66 MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); 61 MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension);
67 ASSERT_TRUE(handler == NULL); 62 ASSERT_TRUE(handler == NULL);
68 } 63 }
69 64
70 } // namespace 65 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698