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

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

Issue 9595001: Apps on NTP should be in order of installation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
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 <map> 5 #include <map>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 MessageLoop message_loop; 542 MessageLoop message_loop;
543 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); 543 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
544 ExtensionUpdater updater( 544 ExtensionUpdater updater(
545 &service, service.extension_prefs(), service.pref_service(), 545 &service, service.extension_prefs(), service.pref_service(),
546 service.profile(), kUpdateFrequencySecs); 546 service.profile(), kUpdateFrequencySecs);
547 updater.Start(); 547 updater.Start();
548 548
549 ManifestFetchData fetch_data(GURL("http://localhost/foo")); 549 ManifestFetchData fetch_data(GURL("http://localhost/foo"));
550 UpdateManifest::Results updates; 550 UpdateManifest::Results updates;
551 551
552 std::set<std::string> ids_for_update_check; 552 std::list<std::string> ids_for_update_check;
553 pending_extension_manager->GetPendingIdsForUpdateCheck( 553 pending_extension_manager->GetPendingIdsForUpdateCheck(
554 &ids_for_update_check); 554 &ids_for_update_check);
555 555
556 std::set<std::string>::const_iterator it; 556 std::list<std::string>::const_iterator it;
557 for (it = ids_for_update_check.begin(); 557 for (it = ids_for_update_check.begin();
558 it != ids_for_update_check.end(); ++it) { 558 it != ids_for_update_check.end(); ++it) {
559 fetch_data.AddExtension(*it, 559 fetch_data.AddExtension(*it,
560 "1.0.0.0", 560 "1.0.0.0",
561 kNeverPingedData, 561 kNeverPingedData,
562 kEmptyUpdateUrlData); 562 kEmptyUpdateUrlData);
563 AddParseResult(*it, "1.1", "http://localhost/e1_1.1.crx", &updates); 563 AddParseResult(*it, "1.1", "http://localhost/e1_1.1.crx", &updates);
564 } 564 }
565 std::vector<int> updateable = 565 std::vector<int> updateable =
566 updater.DetermineUpdates(fetch_data, updates); 566 updater.DetermineUpdates(fetch_data, updates);
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 1261
1262 // TODO(asargent) - (http://crbug.com/12780) add tests for: 1262 // TODO(asargent) - (http://crbug.com/12780) add tests for:
1263 // -prodversionmin (shouldn't update if browser version too old) 1263 // -prodversionmin (shouldn't update if browser version too old)
1264 // -manifests & updates arriving out of order / interleaved 1264 // -manifests & updates arriving out of order / interleaved
1265 // -malformed update url (empty, file://, has query, has a # fragment, etc.) 1265 // -malformed update url (empty, file://, has query, has a # fragment, etc.)
1266 // -An extension gets uninstalled while updates are in progress (so it doesn't 1266 // -An extension gets uninstalled while updates are in progress (so it doesn't
1267 // "come back from the dead") 1267 // "come back from the dead")
1268 // -An extension gets manually updated to v3 while we're downloading v2 (ie 1268 // -An extension gets manually updated to v3 while we're downloading v2 (ie
1269 // you don't get downgraded accidentally) 1269 // you don't get downgraded accidentally)
1270 // -An update manifest mentions multiple updates 1270 // -An update manifest mentions multiple updates
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698