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

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

Issue 10117019: Merge 132065 - Modify IsSyncable to only include Internal items and the Chrome Web Store (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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)
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698