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

Side by Side Diff: chrome/common/extensions/extension_unittest.cc

Issue 10066014: Modify IsSyncable to only include Internal items and the Chrome Web Store (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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
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 "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
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
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)
OLDNEW
« chrome/common/extensions/extension.cc ('K') | « chrome/common/extensions/extension.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698