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
{
18 virtual void OnAccepted() = 0;
19 virtual void OnCanceled() = 0;
20 virtual void OnClosed() = 0;
22 virtual ~Delegate() {}
25 MockTabModalConfirmDialogDelegate(content::WebContents
* web_contents
,
27 virtual ~MockTabModalConfirmDialogDelegate();
29 virtual base::string16
GetTitle() OVERRIDE
;
30 virtual base::string16
GetDialogMessage() OVERRIDE
;
32 virtual void OnAccepted() OVERRIDE
;
33 virtual void OnCanceled() OVERRIDE
;
34 virtual void OnClosed() OVERRIDE
;
39 DISALLOW_COPY_AND_ASSIGN(MockTabModalConfirmDialogDelegate
);
42 class TabModalConfirmDialogTest
43 : public InProcessBrowserTest
,
44 public MockTabModalConfirmDialogDelegate::Delegate
{
46 TabModalConfirmDialogTest();
48 virtual void SetUpOnMainThread() OVERRIDE
;
49 virtual void TearDownOnMainThread() OVERRIDE
;
51 // MockTabModalConfirmDialogDelegate::Delegate:
52 virtual void OnAccepted() OVERRIDE
;
53 virtual void OnCanceled() OVERRIDE
;
54 virtual void OnClosed() OVERRIDE
;
57 // Owned by |dialog_|.
58 MockTabModalConfirmDialogDelegate
* delegate_
;
61 TabModalConfirmDialog
* dialog_
;
68 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogTest
);
71 #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_