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

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

Issue 3166023: When extension is blacklisted by admin policy, it should be removed if alread... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <map> 5 #include <map>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 22 matching lines...) Expand all
33 static int expected_load_flags = 33 static int expected_load_flags =
34 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES; 34 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
35 35
36 // Base class for further specialized test classes. 36 // Base class for further specialized test classes.
37 class MockService : public ExtensionUpdateService { 37 class MockService : public ExtensionUpdateService {
38 public: 38 public:
39 MockService() {} 39 MockService() {}
40 virtual ~MockService() {} 40 virtual ~MockService() {}
41 41
42 virtual const ExtensionList* extensions() const { 42 virtual const ExtensionList* extensions() const {
43 EXPECT_TRUE(false); 43 ADD_FAILURE();
44 return NULL; 44 return NULL;
45 } 45 }
46 46
47 virtual const PendingExtensionMap& pending_extensions() const { 47 virtual const PendingExtensionMap& pending_extensions() const {
48 EXPECT_TRUE(false); 48 ADD_FAILURE();
49 return pending_extensions_; 49 return pending_extensions_;
50 } 50 }
51 51
52 virtual void UpdateExtension(const std::string& id, 52 virtual void UpdateExtension(const std::string& id,
53 const FilePath& extension_path, 53 const FilePath& extension_path,
54 const GURL& download_url) { 54 const GURL& download_url) {
55 EXPECT_TRUE(false); 55 FAIL();
56 } 56 }
57 57
58 virtual Extension* GetExtensionById(const std::string& id, bool) { 58 virtual Extension* GetExtensionById(const std::string& id, bool) {
59 EXPECT_TRUE(false); 59 ADD_FAILURE();
60 return NULL; 60 return NULL;
61 } 61 }
62 62
63 virtual void UpdateExtensionBlacklist( 63 virtual void UpdateExtensionBlacklist(
64 const std::vector<std::string>& blacklist) { 64 const std::vector<std::string>& blacklist) {
65 EXPECT_TRUE(false); 65 FAIL();
66 }
67
68 virtual void CheckAdminBlacklist() {
69 FAIL();
66 } 70 }
67 71
68 virtual bool HasInstalledExtensions() { 72 virtual bool HasInstalledExtensions() {
69 EXPECT_TRUE(false); 73 ADD_FAILURE();
70 return false; 74 return false;
71 } 75 }
72 76
73 virtual ExtensionPrefs* extension_prefs() { return prefs_.prefs(); } 77 virtual ExtensionPrefs* extension_prefs() { return prefs_.prefs(); }
74 78
75 PrefService* pref_service() { return prefs_.pref_service(); } 79 PrefService* pref_service() { return prefs_.pref_service(); }
76 80
77 // Creates test extensions and inserts them into list. The name and 81 // Creates test extensions and inserts them into list. The name and
78 // version are all based on their index. If |update_url| is non-null, it 82 // version are all based on their index. If |update_url| is non-null, it
79 // will be used as the update_url for each extension. 83 // will be used as the update_url for each extension.
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 // -prodversionmin (shouldn't update if browser version too old) 922 // -prodversionmin (shouldn't update if browser version too old)
919 // -manifests & updates arriving out of order / interleaved 923 // -manifests & updates arriving out of order / interleaved
920 // -Profile::GetDefaultRequestContext() returning null 924 // -Profile::GetDefaultRequestContext() returning null
921 // (should not crash, but just do check later) 925 // (should not crash, but just do check later)
922 // -malformed update url (empty, file://, has query, has a # fragment, etc.) 926 // -malformed update url (empty, file://, has query, has a # fragment, etc.)
923 // -An extension gets uninstalled while updates are in progress (so it doesn't 927 // -An extension gets uninstalled while updates are in progress (so it doesn't
924 // "come back from the dead") 928 // "come back from the dead")
925 // -An extension gets manually updated to v3 while we're downloading v2 (ie 929 // -An extension gets manually updated to v3 while we're downloading v2 (ie
926 // you don't get downgraded accidentally) 930 // you don't get downgraded accidentally)
927 // -An update manifest mentions multiple updates 931 // -An update manifest mentions multiple updates
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698