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

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

Issue 195813007: Remove ExtensionService::IsExternalExtensionUninstalled() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 6 years, 9 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
« no previous file with comments | « chrome/browser/extensions/test_extension_service.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 <list> 5 #include <list>
6 #include <map> 6 #include <map>
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 DISALLOW_COPY_AND_ASSIGN(NotificationsObserver); 248 DISALLOW_COPY_AND_ASSIGN(NotificationsObserver);
249 }; 249 };
250 250
251 } // namespace 251 } // namespace
252 252
253 // Base class for further specialized test classes. 253 // Base class for further specialized test classes.
254 class MockService : public TestExtensionService { 254 class MockService : public TestExtensionService {
255 public: 255 public:
256 explicit MockService(TestExtensionPrefs* prefs) 256 explicit MockService(TestExtensionPrefs* prefs)
257 : prefs_(prefs), pending_extension_manager_(*this) { 257 : prefs_(prefs), pending_extension_manager_(*this, &profile_) {}
258 }
259 258
260 virtual ~MockService() {} 259 virtual ~MockService() {}
261 260
262 virtual PendingExtensionManager* pending_extension_manager() OVERRIDE { 261 virtual PendingExtensionManager* pending_extension_manager() OVERRIDE {
263 ADD_FAILURE() << "Subclass should override this if it will " 262 ADD_FAILURE() << "Subclass should override this if it will "
264 << "be accessed by a test."; 263 << "be accessed by a test.";
265 return &pending_extension_manager_; 264 return &pending_extension_manager_;
266 } 265 }
267 266
268 Profile* profile() { return &profile_; } 267 Profile* profile() { return &profile_; }
(...skipping 24 matching lines...) Expand all
293 manifest.SetString(manifest_keys::kUpdateURL, *update_url); 292 manifest.SetString(manifest_keys::kUpdateURL, *update_url);
294 scoped_refptr<Extension> e = 293 scoped_refptr<Extension> e =
295 prefs_->AddExtensionWithManifest(manifest, location); 294 prefs_->AddExtensionWithManifest(manifest, location);
296 ASSERT_TRUE(e.get() != NULL); 295 ASSERT_TRUE(e.get() != NULL);
297 list->push_back(e); 296 list->push_back(e);
298 } 297 }
299 } 298 }
300 299
301 protected: 300 protected:
302 TestExtensionPrefs* const prefs_; 301 TestExtensionPrefs* const prefs_;
302 TestingProfile profile_;
303 PendingExtensionManager pending_extension_manager_; 303 PendingExtensionManager pending_extension_manager_;
304 TestingProfile profile_;
305 304
306 private: 305 private:
307 DISALLOW_COPY_AND_ASSIGN(MockService); 306 DISALLOW_COPY_AND_ASSIGN(MockService);
308 }; 307 };
309 308
310 309
311 bool ShouldInstallExtensionsOnly(const Extension* extension) { 310 bool ShouldInstallExtensionsOnly(const Extension* extension) {
312 return extension->GetType() == Manifest::TYPE_EXTENSION; 311 return extension->GetType() == Manifest::TYPE_EXTENSION;
313 } 312 }
314 313
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 // -prodversionmin (shouldn't update if browser version too old) 1782 // -prodversionmin (shouldn't update if browser version too old)
1784 // -manifests & updates arriving out of order / interleaved 1783 // -manifests & updates arriving out of order / interleaved
1785 // -malformed update url (empty, file://, has query, has a # fragment, etc.) 1784 // -malformed update url (empty, file://, has query, has a # fragment, etc.)
1786 // -An extension gets uninstalled while updates are in progress (so it doesn't 1785 // -An extension gets uninstalled while updates are in progress (so it doesn't
1787 // "come back from the dead") 1786 // "come back from the dead")
1788 // -An extension gets manually updated to v3 while we're downloading v2 (ie 1787 // -An extension gets manually updated to v3 while we're downloading v2 (ie
1789 // you don't get downgraded accidentally) 1788 // you don't get downgraded accidentally)
1790 // -An update manifest mentions multiple updates 1789 // -An update manifest mentions multiple updates
1791 1790
1792 } // namespace extensions 1791 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_extension_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698