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

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

Issue 2310683002: Remove most ScopedVector usage from c/b/extensions. (Closed)
Patch Set: remove scoped_vector includes Created 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 EXPECT_EQ(parsed_install_parameter, info.install_parameter); 459 EXPECT_EQ(parsed_install_parameter, info.install_parameter);
460 460
461 // Remove it so we won't count it again. 461 // Remove it so we won't count it again.
462 prefs_->Remove(info.extension_id, NULL); 462 prefs_->Remove(info.extension_id, NULL);
463 } 463 }
464 return true; 464 return true;
465 } 465 }
466 466
467 void OnExternalProviderUpdateComplete( 467 void OnExternalProviderUpdateComplete(
468 const ExternalProviderInterface* provider, 468 const ExternalProviderInterface* provider,
469 const ScopedVector<ExternalInstallInfoUpdateUrl>& update_url_extensions, 469 const std::vector<std::unique_ptr<ExternalInstallInfoUpdateUrl>>&
470 const ScopedVector<ExternalInstallInfoFile>& file_extensions, 470 update_url_extensions,
471 const std::vector<std::unique_ptr<ExternalInstallInfoFile>>&
472 file_extensions,
471 const std::set<std::string>& removed_extensions) override { 473 const std::set<std::string>& removed_extensions) override {
472 ADD_FAILURE() << "MockProviderVisitor does not provide incremental updates," 474 ADD_FAILURE() << "MockProviderVisitor does not provide incremental updates,"
473 " use MockUpdateProviderVisitor instead."; 475 " use MockUpdateProviderVisitor instead.";
474 } 476 }
475 477
476 void OnExternalProviderReady( 478 void OnExternalProviderReady(
477 const extensions::ExternalProviderInterface* provider) override { 479 const extensions::ExternalProviderInterface* provider) override {
478 EXPECT_EQ(provider, provider_.get()); 480 EXPECT_EQ(provider, provider_.get());
479 EXPECT_TRUE(provider->IsReady()); 481 EXPECT_TRUE(provider->IsReady());
480 } 482 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 530
529 std::unique_ptr<base::DictionaryValue> new_prefs = 531 std::unique_ptr<base::DictionaryValue> new_prefs =
530 GetDictionaryFromJSON(json_data); 532 GetDictionaryFromJSON(json_data);
531 if (!new_prefs) 533 if (!new_prefs)
532 return; 534 return;
533 provider_->UpdatePrefs(new_prefs.release()); 535 provider_->UpdatePrefs(new_prefs.release());
534 } 536 }
535 537
536 void OnExternalProviderUpdateComplete( 538 void OnExternalProviderUpdateComplete(
537 const ExternalProviderInterface* provider, 539 const ExternalProviderInterface* provider,
538 const ScopedVector<ExternalInstallInfoUpdateUrl>& update_url_extensions, 540 const std::vector<std::unique_ptr<ExternalInstallInfoUpdateUrl>>&
539 const ScopedVector<ExternalInstallInfoFile>& file_extensions, 541 update_url_extensions,
542 const std::vector<std::unique_ptr<ExternalInstallInfoFile>>&
543 file_extensions,
540 const std::set<std::string>& removed_extensions) override { 544 const std::set<std::string>& removed_extensions) override {
541 for (auto* extension_info : update_url_extensions) 545 for (const auto& extension_info : update_url_extensions)
542 update_url_extension_ids_.insert(extension_info->extension_id); 546 update_url_extension_ids_.insert(extension_info->extension_id);
543 EXPECT_EQ(update_url_extension_ids_.size(), update_url_extensions.size()); 547 EXPECT_EQ(update_url_extension_ids_.size(), update_url_extensions.size());
544 548
545 for (auto* extension_info : file_extensions) 549 for (const auto& extension_info : file_extensions)
546 file_extension_ids_.insert(extension_info->extension_id); 550 file_extension_ids_.insert(extension_info->extension_id);
547 EXPECT_EQ(file_extension_ids_.size(), file_extensions.size()); 551 EXPECT_EQ(file_extension_ids_.size(), file_extensions.size());
548 552
549 for (const auto& extension_id : removed_extensions) 553 for (const auto& extension_id : removed_extensions)
550 removed_extension_ids_.insert(extension_id); 554 removed_extension_ids_.insert(extension_id);
551 } 555 }
552 556
553 size_t GetUpdateURLExtensionCount() { 557 size_t GetUpdateURLExtensionCount() {
554 return update_url_extension_ids_.size(); 558 return update_url_extension_ids_.size();
555 } 559 }
(...skipping 6356 matching lines...) Expand 10 before | Expand all | Expand 10 after
6912 6916
6913 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, 6917 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
6914 content::Source<Profile>(profile()), 6918 content::Source<Profile>(profile()),
6915 content::NotificationService::NoDetails()); 6919 content::NotificationService::NoDetails());
6916 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); 6920 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
6917 EXPECT_EQ(0u, registry()->enabled_extensions().size()); 6921 EXPECT_EQ(0u, registry()->enabled_extensions().size());
6918 EXPECT_EQ(0u, registry()->disabled_extensions().size()); 6922 EXPECT_EQ(0u, registry()->disabled_extensions().size());
6919 EXPECT_EQ(0u, registry()->terminated_extensions().size()); 6923 EXPECT_EQ(0u, registry()->terminated_extensions().size());
6920 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); 6924 EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
6921 } 6925 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/external_policy_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698