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

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

Issue 8879022: retry 113568 - extensions: remove install/uninstall terminology (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_value_serializer.h" 10 #include "base/json/json_value_serializer.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 scoped_refptr<Extension> extension; 552 scoped_refptr<Extension> extension;
553 extension = LoadManifest("permissions", "many-apis.json"); 553 extension = LoadManifest("permissions", "many-apis.json");
554 std::vector<string16> warnings = extension->GetPermissionMessageStrings(); 554 std::vector<string16> warnings = extension->GetPermissionMessageStrings();
555 ASSERT_EQ(6u, warnings.size()); 555 ASSERT_EQ(6u, warnings.size());
556 EXPECT_EQ("Your data on api.flickr.com", 556 EXPECT_EQ("Your data on api.flickr.com",
557 UTF16ToUTF8(warnings[0])); 557 UTF16ToUTF8(warnings[0]));
558 EXPECT_EQ("Your bookmarks", UTF16ToUTF8(warnings[1])); 558 EXPECT_EQ("Your bookmarks", UTF16ToUTF8(warnings[1]));
559 EXPECT_EQ("Your physical location", UTF16ToUTF8(warnings[2])); 559 EXPECT_EQ("Your physical location", UTF16ToUTF8(warnings[2]));
560 EXPECT_EQ("Your browsing history", UTF16ToUTF8(warnings[3])); 560 EXPECT_EQ("Your browsing history", UTF16ToUTF8(warnings[3]));
561 EXPECT_EQ("Your tabs and browsing activity", UTF16ToUTF8(warnings[4])); 561 EXPECT_EQ("Your tabs and browsing activity", UTF16ToUTF8(warnings[4]));
562 EXPECT_EQ("Your list of installed apps, extensions, and themes", 562 EXPECT_EQ("Your list of apps, extensions, and themes",
563 UTF16ToUTF8(warnings[5])); 563 UTF16ToUTF8(warnings[5]));
564 } 564 }
565 565
566 TEST(ExtensionTest, GetPermissionMessages_ManyHosts) { 566 TEST(ExtensionTest, GetPermissionMessages_ManyHosts) {
567 scoped_refptr<Extension> extension; 567 scoped_refptr<Extension> extension;
568 extension = LoadManifest("permissions", "many-hosts.json"); 568 extension = LoadManifest("permissions", "many-hosts.json");
569 std::vector<string16> warnings = extension->GetPermissionMessageStrings(); 569 std::vector<string16> warnings = extension->GetPermissionMessageStrings();
570 ASSERT_EQ(1u, warnings.size()); 570 ASSERT_EQ(1u, warnings.size());
571 EXPECT_EQ("Your data on encrypted.google.com and www.google.com", 571 EXPECT_EQ("Your data on encrypted.google.com and www.google.com",
572 UTF16ToUTF8(warnings[0])); 572 UTF16ToUTF8(warnings[0]));
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } 920 }
921 921
922 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { 922 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) {
923 scoped_refptr<Extension> extension( 923 scoped_refptr<Extension> extension(
924 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), 924 MakeSyncTestExtension(EXTENSION, GURL(), GURL(),
925 Extension::INTERNAL, 2, FilePath())); 925 Extension::INTERNAL, 2, FilePath()));
926 if (extension) 926 if (extension)
927 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); 927 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE);
928 } 928 }
929 #endif // !defined(OS_CHROMEOS) 929 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698