Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / tab_modal_confirm_dialog_browsertest.h
blobd024bfa7f7464a1ba79f4e8883c4678e687d5203
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_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_
6 #define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
11 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
12 #include "chrome/test/base/in_process_browser_test.h"
14 class MockTabModalConfirmDialogDelegate : public TabModalConfirmDialogDelegate {
15 public:
16 class Delegate {
17 public:
18 virtual void OnAccepted() = 0;
19 virtual void OnCanceled() = 0;
20 virtual void OnClosed() = 0;
21 protected:
22 virtual ~Delegate() {}
25 MockTabModalConfirmDialogDelegate(content::WebContents* web_contents,
26 Delegate* delegate);
27 ~MockTabModalConfirmDialogDelegate() override;
29 base::string16 GetTitle() override;
30 base::string16 GetDialogMessage() override;
32 void OnAccepted() override;
33 void OnCanceled() override;
34 void OnClosed() override;
36 private:
37 Delegate* delegate_;
39 DISALLOW_COPY_AND_ASSIGN(MockTabModalConfirmDialogDelegate);
42 class TabModalConfirmDialogTest
43 : public InProcessBrowserTest,
44 public MockTabModalConfirmDialogDelegate::Delegate {
45 public:
46 TabModalConfirmDialogTest();
48 void SetUpOnMainThread() override;
49 void TearDownOnMainThread() override;
51 // MockTabModalConfirmDialogDelegate::Delegate:
52 void OnAccepted() override;
53 void OnCanceled() override;
54 void OnClosed() override;
56 protected:
57 // Owned by |dialog_|.
58 MockTabModalConfirmDialogDelegate* delegate_;
60 // Deletes itself.
61 TabModalConfirmDialog* dialog_;
63 int accepted_count_;
64 int canceled_count_;
65 int closed_count_;
67 private:
68 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogTest);
71 #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_