| 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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 914 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 915 Extension::INTERNAL, 0, FilePath())); | 915 Extension::INTERNAL, 0, FilePath())); |
| 916 EXPECT_FALSE(extension->ShouldDisplayInLauncher()); | 916 EXPECT_FALSE(extension->ShouldDisplayInLauncher()); |
| 917 | 917 |
| 918 scoped_refptr<Extension> app( | 918 scoped_refptr<Extension> app( |
| 919 MakeSyncTestExtension(APP, GURL(), GURL("http://www.google.com"), | 919 MakeSyncTestExtension(APP, GURL(), GURL("http://www.google.com"), |
| 920 Extension::INTERNAL, 0, FilePath())); | 920 Extension::INTERNAL, 0, FilePath())); |
| 921 EXPECT_TRUE(app->ShouldDisplayInLauncher()); | 921 EXPECT_TRUE(app->ShouldDisplayInLauncher()); |
| 922 } | 922 } |
| 923 | 923 |
| 924 TEST(ExtensionTest, OnlySyncInternal) { |
| 925 scoped_refptr<Extension> extension_internal( |
| 926 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 927 Extension::INTERNAL, 0, FilePath())); |
| 928 EXPECT_TRUE(extension_internal->IsSyncable()); |
| 929 |
| 930 scoped_refptr<Extension> extension_noninternal( |
| 931 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 932 Extension::COMPONENT, 0, FilePath())); |
| 933 EXPECT_FALSE(extension_noninternal->IsSyncable()); |
| 934 } |
| 935 |
| 924 TEST(ExtensionTest, ExtensionKeybindingParsing) { | 936 TEST(ExtensionTest, ExtensionKeybindingParsing) { |
| 925 const ui::Accelerator None = ui::Accelerator(); | 937 const ui::Accelerator None = ui::Accelerator(); |
| 926 const ui::Accelerator ShiftF = | 938 const ui::Accelerator ShiftF = |
| 927 ui::Accelerator(ui::VKEY_F, true, false, false); | 939 ui::Accelerator(ui::VKEY_F, true, false, false); |
| 928 const ui::Accelerator CtrlF = | 940 const ui::Accelerator CtrlF = |
| 929 ui::Accelerator(ui::VKEY_F, false, true, false); | 941 ui::Accelerator(ui::VKEY_F, false, true, false); |
| 930 const ui::Accelerator AltF = | 942 const ui::Accelerator AltF = |
| 931 ui::Accelerator(ui::VKEY_F, false, false, true); | 943 ui::Accelerator(ui::VKEY_F, false, false, true); |
| 932 const ui::Accelerator CtrlShiftF = | 944 const ui::Accelerator CtrlShiftF = |
| 933 ui::Accelerator(ui::VKEY_F, true, true, false); | 945 ui::Accelerator(ui::VKEY_F, true, true, false); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 } | 1029 } |
| 1018 | 1030 |
| 1019 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { | 1031 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { |
| 1020 scoped_refptr<Extension> extension( | 1032 scoped_refptr<Extension> extension( |
| 1021 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 1033 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 1022 Extension::INTERNAL, 2, FilePath())); | 1034 Extension::INTERNAL, 2, FilePath())); |
| 1023 if (extension) | 1035 if (extension) |
| 1024 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); | 1036 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); |
| 1025 } | 1037 } |
| 1026 #endif // !defined(OS_CHROMEOS) | 1038 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |