Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / extensions / extension_install_prompt_test_utils.h
blob07084e9ba36981cf1a6b14ba896e99886d964fb0
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 "base/memory/ref_counted.h"
9 #include "chrome/browser/extensions/extension_install_prompt.h"
11 namespace chrome {
13 // A simple delegate implementation that counts the number of times
14 // |InstallUIProceed| and |InstallUIAbort| are called.
15 class MockExtensionInstallPromptDelegate
16 : public ExtensionInstallPrompt::Delegate {
17 public:
18 MockExtensionInstallPromptDelegate()
19 : proceed_count_(0),
20 abort_count_(0) {}
22 // ExtensionInstallPrompt::Delegate overrides.
23 void InstallUIProceed() override;
24 void InstallUIAbort(bool user_initiated) override;
26 int proceed_count() { return proceed_count_; }
27 int abort_count() { return abort_count_; }
29 protected:
30 int proceed_count_;
31 int abort_count_;
34 // Loads the test extension from the given test directory and manifest file.
35 scoped_refptr<extensions::Extension> LoadInstallPromptExtension(
36 const char* extension_dir_name,
37 const char* manifest_file);
39 // Loads the default install_prompt test extension.
40 scoped_refptr<extensions::Extension> LoadInstallPromptExtension();
42 // Loads the icon for the install prompt extension.
43 gfx::Image LoadInstallPromptIcon();
45 // Builds a prompt using the given extension.
46 scoped_refptr<ExtensionInstallPrompt::Prompt> BuildExtensionInstallPrompt(
47 extensions::Extension* extension);
49 scoped_refptr<ExtensionInstallPrompt::Prompt>
50 BuildExtensionPostInstallPermissionsPrompt(
51 extensions::Extension* extension);
53 } // namespace chrome
55 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_PROMPT_TEST_UTILS_H_