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

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

Issue 22794012: Rename extension_manifest_keys namespace to extensions::manifest_keys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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) 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 23 matching lines...) Expand all
34 #include "chrome/browser/extensions/test_extension_service.h" 34 #include "chrome/browser/extensions/test_extension_service.h"
35 #include "chrome/browser/extensions/test_extension_system.h" 35 #include "chrome/browser/extensions/test_extension_system.h"
36 #include "chrome/browser/extensions/updater/extension_downloader.h" 36 #include "chrome/browser/extensions/updater/extension_downloader.h"
37 #include "chrome/browser/extensions/updater/extension_downloader_delegate.h" 37 #include "chrome/browser/extensions/updater/extension_downloader_delegate.h"
38 #include "chrome/browser/extensions/updater/extension_updater.h" 38 #include "chrome/browser/extensions/updater/extension_updater.h"
39 #include "chrome/browser/extensions/updater/manifest_fetch_data.h" 39 #include "chrome/browser/extensions/updater/manifest_fetch_data.h"
40 #include "chrome/browser/extensions/updater/request_queue_impl.h" 40 #include "chrome/browser/extensions/updater/request_queue_impl.h"
41 #include "chrome/browser/google/google_util.h" 41 #include "chrome/browser/google/google_util.h"
42 #include "chrome/browser/prefs/pref_service_syncable.h" 42 #include "chrome/browser/prefs/pref_service_syncable.h"
43 #include "chrome/common/extensions/extension.h" 43 #include "chrome/common/extensions/extension.h"
44 #include "chrome/common/extensions/extension_manifest_constants.h"
45 #include "chrome/common/omaha_query_params/omaha_query_params.h" 44 #include "chrome/common/omaha_query_params/omaha_query_params.h"
46 #include "chrome/common/pref_names.h" 45 #include "chrome/common/pref_names.h"
47 #include "chrome/test/base/testing_profile.h" 46 #include "chrome/test/base/testing_profile.h"
48 #include "content/public/browser/notification_details.h" 47 #include "content/public/browser/notification_details.h"
49 #include "content/public/browser/notification_observer.h" 48 #include "content/public/browser/notification_observer.h"
50 #include "content/public/browser/notification_registrar.h" 49 #include "content/public/browser/notification_registrar.h"
51 #include "content/public/browser/notification_service.h" 50 #include "content/public/browser/notification_service.h"
52 #include "content/public/browser/notification_source.h" 51 #include "content/public/browser/notification_source.h"
53 #include "content/public/browser/render_process_host.h" 52 #include "content/public/browser/render_process_host.h"
54 #include "content/public/test/test_browser_thread_bundle.h" 53 #include "content/public/test/test_browser_thread_bundle.h"
55 #include "content/public/test/test_utils.h" 54 #include "content/public/test/test_utils.h"
56 #include "extensions/common/id_util.h" 55 #include "extensions/common/id_util.h"
56 #include "extensions/common/manifest_constants.h"
57 #include "libxml/globals.h" 57 #include "libxml/globals.h"
58 #include "net/base/backoff_entry.h" 58 #include "net/base/backoff_entry.h"
59 #include "net/base/escape.h" 59 #include "net/base/escape.h"
60 #include "net/base/load_flags.h" 60 #include "net/base/load_flags.h"
61 #include "net/url_request/test_url_fetcher_factory.h" 61 #include "net/url_request/test_url_fetcher_factory.h"
62 #include "net/url_request/url_request_status.h" 62 #include "net/url_request/url_request_status.h"
63 #include "testing/gmock/include/gmock/gmock.h" 63 #include "testing/gmock/include/gmock/gmock.h"
64 #include "testing/gtest/include/gtest/gtest.h" 64 #include "testing/gtest/include/gtest/gtest.h"
65 65
66 #if defined(OS_CHROMEOS) 66 #if defined(OS_CHROMEOS)
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Creates test extensions and inserts them into list. The name and 264 // Creates test extensions and inserts them into list. The name and
265 // version are all based on their index. If |update_url| is non-null, it 265 // version are all based on their index. If |update_url| is non-null, it
266 // will be used as the update_url for each extension. 266 // will be used as the update_url for each extension.
267 // The |id| is used to distinguish extension names and make sure that 267 // The |id| is used to distinguish extension names and make sure that
268 // no two extensions share the same name. 268 // no two extensions share the same name.
269 void CreateTestExtensions(int id, int count, ExtensionList *list, 269 void CreateTestExtensions(int id, int count, ExtensionList *list,
270 const std::string* update_url, 270 const std::string* update_url,
271 Manifest::Location location) { 271 Manifest::Location location) {
272 for (int i = 1; i <= count; i++) { 272 for (int i = 1; i <= count; i++) {
273 DictionaryValue manifest; 273 DictionaryValue manifest;
274 manifest.SetString(extension_manifest_keys::kVersion, 274 manifest.SetString(manifest_keys::kVersion,
275 base::StringPrintf("%d.0.0.0", i)); 275 base::StringPrintf("%d.0.0.0", i));
276 manifest.SetString(extension_manifest_keys::kName, 276 manifest.SetString(manifest_keys::kName,
277 base::StringPrintf("Extension %d.%d", id, i)); 277 base::StringPrintf("Extension %d.%d", id, i));
278 if (update_url) 278 if (update_url)
279 manifest.SetString(extension_manifest_keys::kUpdateURL, *update_url); 279 manifest.SetString(manifest_keys::kUpdateURL, *update_url);
280 scoped_refptr<Extension> e = 280 scoped_refptr<Extension> e =
281 prefs_->AddExtensionWithManifest(manifest, location); 281 prefs_->AddExtensionWithManifest(manifest, location);
282 ASSERT_TRUE(e.get() != NULL); 282 ASSERT_TRUE(e.get() != NULL);
283 list->push_back(e); 283 list->push_back(e);
284 } 284 }
285 } 285 }
286 286
287 protected: 287 protected:
288 TestExtensionPrefs* const prefs_; 288 TestExtensionPrefs* const prefs_;
289 PendingExtensionManager pending_extension_manager_; 289 PendingExtensionManager pending_extension_manager_;
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 // -prodversionmin (shouldn't update if browser version too old) 1753 // -prodversionmin (shouldn't update if browser version too old)
1754 // -manifests & updates arriving out of order / interleaved 1754 // -manifests & updates arriving out of order / interleaved
1755 // -malformed update url (empty, file://, has query, has a # fragment, etc.) 1755 // -malformed update url (empty, file://, has query, has a # fragment, etc.)
1756 // -An extension gets uninstalled while updates are in progress (so it doesn't 1756 // -An extension gets uninstalled while updates are in progress (so it doesn't
1757 // "come back from the dead") 1757 // "come back from the dead")
1758 // -An extension gets manually updated to v3 while we're downloading v2 (ie 1758 // -An extension gets manually updated to v3 while we're downloading v2 (ie
1759 // you don't get downgraded accidentally) 1759 // you don't get downgraded accidentally)
1760 // -An update manifest mentions multiple updates 1760 // -An update manifest mentions multiple updates
1761 1761
1762 } // namespace extensions 1762 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_extension_prefs.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698