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/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 LoadAndExpectSuccess("tts_engine_valid.json")); | 768 LoadAndExpectSuccess("tts_engine_valid.json")); |
769 | 769 |
770 ASSERT_EQ(1u, extension->tts_voices().size()); | 770 ASSERT_EQ(1u, extension->tts_voices().size()); |
771 EXPECT_EQ("name", extension->tts_voices()[0].voice_name); | 771 EXPECT_EQ("name", extension->tts_voices()[0].voice_name); |
772 EXPECT_EQ("en-US", extension->tts_voices()[0].lang); | 772 EXPECT_EQ("en-US", extension->tts_voices()[0].lang); |
773 EXPECT_EQ("female", extension->tts_voices()[0].gender); | 773 EXPECT_EQ("female", extension->tts_voices()[0].gender); |
774 EXPECT_EQ(3U, extension->tts_voices()[0].event_types.size()); | 774 EXPECT_EQ(3U, extension->tts_voices()[0].event_types.size()); |
775 } | 775 } |
776 | 776 |
777 TEST_F(ExtensionManifestTest, WebIntents) { | 777 TEST_F(ExtensionManifestTest, WebIntents) { |
| 778 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableWebIntents); |
| 779 |
778 LoadAndExpectError("intent_invalid_1.json", | 780 LoadAndExpectError("intent_invalid_1.json", |
779 extension_manifest_errors::kInvalidIntents); | 781 extension_manifest_errors::kInvalidIntents); |
780 LoadAndExpectError("intent_invalid_2.json", | 782 LoadAndExpectError("intent_invalid_2.json", |
781 extension_manifest_errors::kInvalidIntent); | 783 extension_manifest_errors::kInvalidIntent); |
782 LoadAndExpectError("intent_invalid_3.json", | 784 LoadAndExpectError("intent_invalid_3.json", |
783 extension_manifest_errors::kInvalidIntentPath); | 785 extension_manifest_errors::kInvalidIntentPath); |
784 LoadAndExpectError("intent_invalid_4.json", | 786 LoadAndExpectError("intent_invalid_4.json", |
785 extension_manifest_errors::kInvalidIntentDisposition); | 787 extension_manifest_errors::kInvalidIntentDisposition); |
786 LoadAndExpectError("intent_invalid_5.json", | 788 LoadAndExpectError("intent_invalid_5.json", |
787 extension_manifest_errors::kInvalidIntentType); | 789 extension_manifest_errors::kInvalidIntentType); |
(...skipping 25 matching lines...) Expand all Loading... |
813 EXPECT_EQ("*", UTF16ToUTF8(extension->intents_services()[0].type)); | 815 EXPECT_EQ("*", UTF16ToUTF8(extension->intents_services()[0].type)); |
814 EXPECT_EQ("http://webintents.org/share", | 816 EXPECT_EQ("http://webintents.org/share", |
815 UTF16ToUTF8(extension->intents_services()[0].action)); | 817 UTF16ToUTF8(extension->intents_services()[0].action)); |
816 EXPECT_TRUE(extension->intents_services()[0].service_url.is_empty()); | 818 EXPECT_TRUE(extension->intents_services()[0].service_url.is_empty()); |
817 EXPECT_EQ("", UTF16ToUTF8(extension->intents_services()[0].title)); | 819 EXPECT_EQ("", UTF16ToUTF8(extension->intents_services()[0].title)); |
818 EXPECT_EQ(webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW, | 820 EXPECT_EQ(webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW, |
819 extension->intents_services()[0].disposition); | 821 extension->intents_services()[0].disposition); |
820 } | 822 } |
821 | 823 |
822 TEST_F(ExtensionManifestTest, WebIntentsWithMultipleMimeTypes) { | 824 TEST_F(ExtensionManifestTest, WebIntentsWithMultipleMimeTypes) { |
| 825 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableWebIntents); |
| 826 |
823 scoped_refptr<Extension> extension( | 827 scoped_refptr<Extension> extension( |
824 LoadAndExpectSuccess("intent_valid_multitype.json")); | 828 LoadAndExpectSuccess("intent_valid_multitype.json")); |
825 ASSERT_TRUE(extension.get() != NULL); | 829 ASSERT_TRUE(extension.get() != NULL); |
826 | 830 |
827 ASSERT_EQ(2u, extension->intents_services().size()); | 831 ASSERT_EQ(2u, extension->intents_services().size()); |
828 | 832 |
829 // One registration with multiple types generates a separate service for | 833 // One registration with multiple types generates a separate service for |
830 // each MIME type. | 834 // each MIME type. |
831 for (int i = 0; i < 2; ++i) { | 835 for (int i = 0; i < 2; ++i) { |
832 EXPECT_EQ("http://webintents.org/share", | 836 EXPECT_EQ("http://webintents.org/share", |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 EXPECT_EQ("", extension->page_action()->id()); | 1062 EXPECT_EQ("", extension->page_action()->id()); |
1059 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size()); | 1063 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size()); |
1060 EXPECT_EQ("", extension->page_action()->GetTitle( | 1064 EXPECT_EQ("", extension->page_action()->GetTitle( |
1061 ExtensionAction::kDefaultTabId)); | 1065 ExtensionAction::kDefaultTabId)); |
1062 EXPECT_FALSE(extension->page_action()->HasPopup( | 1066 EXPECT_FALSE(extension->page_action()->HasPopup( |
1063 ExtensionAction::kDefaultTabId)); | 1067 ExtensionAction::kDefaultTabId)); |
1064 | 1068 |
1065 LoadAndExpectError("page_action_manifest_version_2b.json", | 1069 LoadAndExpectError("page_action_manifest_version_2b.json", |
1066 errors::kInvalidPageActionPopup); | 1070 errors::kInvalidPageActionPopup); |
1067 } | 1071 } |
OLD | NEW |