app_shell: Add version number in user agent
[chromium-blink-merge.git] / chrome / browser / ui / tab_modal_confirm_dialog_browsertest.h
blob533cfd538d0a74704e2d4ce39c93d9d029889744
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 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;
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 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;
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_