| 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 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 928 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 929 Extension::INTERNAL, 0, FilePath())); | 929 Extension::INTERNAL, 0, FilePath())); |
| 930 EXPECT_FALSE(extension->ShouldDisplayInLauncher()); | 930 EXPECT_FALSE(extension->ShouldDisplayInLauncher()); |
| 931 | 931 |
| 932 scoped_refptr<Extension> app( | 932 scoped_refptr<Extension> app( |
| 933 MakeSyncTestExtension(APP, GURL(), GURL("http://www.google.com"), | 933 MakeSyncTestExtension(APP, GURL(), GURL("http://www.google.com"), |
| 934 Extension::INTERNAL, 0, FilePath())); | 934 Extension::INTERNAL, 0, FilePath())); |
| 935 EXPECT_TRUE(app->ShouldDisplayInLauncher()); | 935 EXPECT_TRUE(app->ShouldDisplayInLauncher()); |
| 936 } | 936 } |
| 937 | 937 |
| 938 TEST(ExtensionTest, OnlySyncInternal) { |
| 939 scoped_refptr<Extension> extension_internal( |
| 940 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 941 Extension::INTERNAL, 0, FilePath())); |
| 942 EXPECT_TRUE(extension_internal->IsSyncable()); |
| 943 |
| 944 scoped_refptr<Extension> extension_noninternal( |
| 945 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 946 Extension::COMPONENT, 0, FilePath())); |
| 947 EXPECT_FALSE(extension_noninternal->IsSyncable()); |
| 948 } |
| 949 |
| 938 TEST(ExtensionTest, ExtensionKeybindingParsing) { | 950 TEST(ExtensionTest, ExtensionKeybindingParsing) { |
| 939 const ui::Accelerator None = ui::Accelerator(); | 951 const ui::Accelerator None = ui::Accelerator(); |
| 940 const ui::Accelerator ShiftF = | 952 const ui::Accelerator ShiftF = |
| 941 ui::Accelerator(ui::VKEY_F, true, false, false); | 953 ui::Accelerator(ui::VKEY_F, true, false, false); |
| 942 const ui::Accelerator CtrlF = | 954 const ui::Accelerator CtrlF = |
| 943 ui::Accelerator(ui::VKEY_F, false, true, false); | 955 ui::Accelerator(ui::VKEY_F, false, true, false); |
| 944 const ui::Accelerator AltF = | 956 const ui::Accelerator AltF = |
| 945 ui::Accelerator(ui::VKEY_F, false, false, true); | 957 ui::Accelerator(ui::VKEY_F, false, false, true); |
| 946 const ui::Accelerator CtrlShiftF = | 958 const ui::Accelerator CtrlShiftF = |
| 947 ui::Accelerator(ui::VKEY_F, true, true, false); | 959 ui::Accelerator(ui::VKEY_F, true, true, false); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 } | 1132 } |
| 1121 | 1133 |
| 1122 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { | 1134 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { |
| 1123 scoped_refptr<Extension> extension( | 1135 scoped_refptr<Extension> extension( |
| 1124 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 1136 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 1125 Extension::INTERNAL, 2, FilePath())); | 1137 Extension::INTERNAL, 2, FilePath())); |
| 1126 if (extension) | 1138 if (extension) |
| 1127 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); | 1139 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); |
| 1128 } | 1140 } |
| 1129 #endif // !defined(OS_CHROMEOS) | 1141 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |