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

Side by Side Diff: chrome/browser/extensions/extension_prefs_unittest.cc

Issue 10855190: Disable sync for default apps (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments Created 8 years, 3 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
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 "extension_prefs_unittest.h" 5 #include "extension_prefs_unittest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 dictionary, Extension::INTERNAL, Extension::FROM_WEBSTORE); 789 dictionary, Extension::INTERNAL, Extension::FROM_WEBSTORE);
790 } 790 }
791 791
792 { 792 {
793 base::DictionaryValue dictionary; 793 base::DictionaryValue dictionary;
794 dictionary.SetString(extension_manifest_keys::kName, "from_bookmark"); 794 dictionary.SetString(extension_manifest_keys::kName, "from_bookmark");
795 dictionary.SetString(extension_manifest_keys::kVersion, "0.1"); 795 dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
796 bookmark_extension_ = prefs_.AddExtensionWithManifestAndFlags( 796 bookmark_extension_ = prefs_.AddExtensionWithManifestAndFlags(
797 dictionary, Extension::INTERNAL, Extension::FROM_BOOKMARK); 797 dictionary, Extension::INTERNAL, Extension::FROM_BOOKMARK);
798 } 798 }
799
800 {
801 base::DictionaryValue dictionary;
802 dictionary.SetString(extension_manifest_keys::kName,
803 "was_installed_by_default");
804 dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
805 default_extension_ = prefs_.AddExtensionWithManifestAndFlags(
806 dictionary,
807 Extension::INTERNAL,
808 Extension::WAS_INSTALLED_BY_DEFAULT);
809 }
799 } 810 }
800 811
801 virtual void Verify() { 812 virtual void Verify() {
802 EXPECT_TRUE(prefs()->IsFromWebStore(webstore_extension_->id())); 813 EXPECT_TRUE(prefs()->IsFromWebStore(webstore_extension_->id()));
803 EXPECT_FALSE(prefs()->IsFromBookmark(webstore_extension_->id())); 814 EXPECT_FALSE(prefs()->IsFromBookmark(webstore_extension_->id()));
804 815
805 EXPECT_TRUE(prefs()->IsFromBookmark(bookmark_extension_->id())); 816 EXPECT_TRUE(prefs()->IsFromBookmark(bookmark_extension_->id()));
806 EXPECT_FALSE(prefs()->IsFromWebStore(bookmark_extension_->id())); 817 EXPECT_FALSE(prefs()->IsFromWebStore(bookmark_extension_->id()));
818
819 EXPECT_TRUE(prefs()->WasInstalledByDefault(default_extension_->id()));
807 } 820 }
808 821
809 private: 822 private:
810 scoped_refptr<Extension> webstore_extension_; 823 scoped_refptr<Extension> webstore_extension_;
811 scoped_refptr<Extension> bookmark_extension_; 824 scoped_refptr<Extension> bookmark_extension_;
825 scoped_refptr<Extension> default_extension_;
812 }; 826 };
813 TEST_F(ExtensionPrefsFlags, ExtensionPrefsFlags) {} 827 TEST_F(ExtensionPrefsFlags, ExtensionPrefsFlags) {}
814 828
815 namespace keys = extension_manifest_keys; 829 namespace keys = extension_manifest_keys;
816 830
817 ExtensionPrefsPrepopulatedTest::ExtensionPrefsPrepopulatedTest() 831 ExtensionPrefsPrepopulatedTest::ExtensionPrefsPrepopulatedTest()
818 : ExtensionPrefsTest(), 832 : ExtensionPrefsTest(),
819 ext1_(NULL), 833 ext1_(NULL),
820 ext2_(NULL), 834 ext2_(NULL),
821 ext3_(NULL), 835 ext3_(NULL),
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 EXPECT_EQ(string16(), error16); 1282 EXPECT_EQ(string16(), error16);
1269 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); 1283 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16));
1270 EXPECT_EQ(string16(), error16); 1284 EXPECT_EQ(string16(), error16);
1271 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); 1285 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16));
1272 EXPECT_EQ(string16(), error16); 1286 EXPECT_EQ(string16(), error16);
1273 } 1287 }
1274 }; 1288 };
1275 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} 1289 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {}
1276 1290
1277 } // namespace extensions 1291 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698