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

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

Issue 11275069: Perform install tasks for newly installed or upgraded component apps/extensions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: various fixes Created 8 years, 1 month 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 "chrome/browser/extensions/extension_service_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 4681 matching lines...) Expand 10 before | Expand all | Expand 10 after
4692 service_->Init(); 4692 service_->Init();
4693 4693
4694 // Note that we do not pump messages -- the extension should be loaded 4694 // Note that we do not pump messages -- the extension should be loaded
4695 // immediately. 4695 // immediately.
4696 4696
4697 EXPECT_EQ(0u, GetErrors().size()); 4697 EXPECT_EQ(0u, GetErrors().size());
4698 ASSERT_EQ(1u, loaded_.size()); 4698 ASSERT_EQ(1u, loaded_.size());
4699 EXPECT_EQ(Extension::COMPONENT, loaded_[0]->location()); 4699 EXPECT_EQ(Extension::COMPONENT, loaded_[0]->location());
4700 EXPECT_EQ(1u, service_->extensions()->size()); 4700 EXPECT_EQ(1u, service_->extensions()->size());
4701 4701
4702 // Component extensions shouldn't get recorded in the prefs. 4702 // Component extensions get a prefs entry on first install.
4703 ValidatePrefKeyCount(0); 4703 ValidatePrefKeyCount(1);
4704 4704
4705 // Reload all extensions, and make sure it comes back. 4705 // Reload all extensions, and make sure it comes back.
4706 std::string extension_id = (*service_->extensions()->begin())->id(); 4706 std::string extension_id = (*service_->extensions()->begin())->id();
4707 loaded_.clear(); 4707 loaded_.clear();
4708 service_->ReloadExtensions(); 4708 service_->ReloadExtensions();
4709 ASSERT_EQ(1u, service_->extensions()->size()); 4709 ASSERT_EQ(1u, service_->extensions()->size());
4710 EXPECT_EQ(extension_id, (*service_->extensions()->begin())->id()); 4710 EXPECT_EQ(extension_id, (*service_->extensions()->begin())->id());
4711 } 4711 }
4712 4712
4713 namespace { 4713 namespace {
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
5837 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5837 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5838 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5838 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5839 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5839 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5840 5840
5841 ExtensionPrefs* prefs = service_->extension_prefs(); 5841 ExtensionPrefs* prefs = service_->extension_prefs();
5842 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5842 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5843 Extension::DISABLE_SIDELOAD_WIPEOUT); 5843 Extension::DISABLE_SIDELOAD_WIPEOUT);
5844 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5844 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5845 Extension::DISABLE_SIDELOAD_WIPEOUT); 5845 Extension::DISABLE_SIDELOAD_WIPEOUT);
5846 } 5846 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698