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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_PROMPT_TEST_UTILS_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_PROMPT_TEST_UTILS_H_
8 #include "chrome/browser/extensions/extension_install_prompt.h"
12 // A simple delegate implementation that counts the number of times
13 // |InstallUIProceed| and |InstallUIAbort| are called.
14 class MockExtensionInstallPromptDelegate
15 : public ExtensionInstallPrompt::Delegate
{
17 MockExtensionInstallPromptDelegate()
21 // ExtensionInstallPrompt::Delegate overrides.
22 virtual void InstallUIProceed() OVERRIDE
;
23 virtual void InstallUIAbort(bool user_initiated
) OVERRIDE
;
25 int proceed_count() { return proceed_count_
; }
26 int abort_count() { return abort_count_
; }
33 // Loads the test extension from the given test directory and manifest file.
34 scoped_refptr
<extensions::Extension
> LoadInstallPromptExtension(
35 const char* extension_dir_name
,
36 const char* manifest_file
);
38 // Loads the default install_prompt test extension.
39 scoped_refptr
<extensions::Extension
> LoadInstallPromptExtension();
41 // Loads the icon for the install prompt extension.
42 gfx::Image
LoadInstallPromptIcon();
44 // Builds a prompt using the given extension.
45 ExtensionInstallPrompt::Prompt
BuildExtensionInstallPrompt(
46 extensions::Extension
* extension
);
48 ExtensionInstallPrompt::Prompt
BuildExtensionPostInstallPermissionsPrompt(
49 extensions::Extension
* extension
);
53 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_PROMPT_TEST_UTILS_H_