diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 21:44:45 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 21:44:45 +0000 |
commit | 7d9ad0b30c0775a7345e965294c9f86bb0d543e5 (patch) | |
tree | 8b5d69fbff00af703b0d330ffe5ca719db9696e5 /chrome/browser/extensions/extension_browsertest.cc | |
parent | 60050d0da7ca869e9c5ffe887cc2c51bc4b51deb (diff) | |
download | chromium_src-7d9ad0b30c0775a7345e965294c9f86bb0d543e5.zip chromium_src-7d9ad0b30c0775a7345e965294c9f86bb0d543e5.tar.gz chromium_src-7d9ad0b30c0775a7345e965294c9f86bb0d543e5.tar.bz2 |
Browser Action Container should not shrink when visible extension is disabled.
We now calculate the visible actions before removing them from the vector
so we can maintain the same number after deletion occurs.
Also added unit tests and fixed a bug in GetTooltip where we were hard-coding
the index to be 0.
BUG=35349
TEST=Covered by new unit test.
Review URL: http://codereview.chromium.org/606008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browsertest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_browsertest.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 7bb8084..9b4ddd8 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -76,8 +76,8 @@ class MockAbortExtensionInstallUI : public ExtensionInstallUI { MockAbortExtensionInstallUI() : ExtensionInstallUI(NULL) {} // Simulate a user abort on an extension installation. - void ConfirmInstall(Delegate* delegate, Extension* extension, SkBitmap* icon) - { + void ConfirmInstall( + Delegate* delegate, Extension* extension, SkBitmap* icon) { delegate->InstallUIAbort(); MessageLoopForUI::current()->Quit(); } @@ -165,6 +165,16 @@ void ExtensionBrowserTest::UninstallExtension(const std::string& extension_id) { service->UninstallExtension(extension_id, false); } +void ExtensionBrowserTest::DisableExtension(const std::string& extension_id) { + ExtensionsService* service = browser()->profile()->GetExtensionsService(); + service->DisableExtension(extension_id); +} + +void ExtensionBrowserTest::EnableExtension(const std::string& extension_id) { + ExtensionsService* service = browser()->profile()->GetExtensionsService(); + service->EnableExtension(extension_id); +} + bool ExtensionBrowserTest::WaitForPageActionCountChangeTo(int count) { NotificationRegistrar registrar; registrar.Add(this, |