Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Side by Side Diff: chrome/browser/ui/test/permission_bubble_browsertest.h

Issue 986333006: Center permission bubble if location bar is hidden in MacOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken tests Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 #ifndef CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSERTEST_H_
6 #define CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSERTEST_H_
7
groby-ooo-7-16 2015/04/08 18:39:15 Why a header file? We usually declare classes inli
hcarmona 2015/04/10 18:54:08 Yes, the intent is that this be shared. Renamed to
groby-ooo-7-16 2015/04/10 20:58:55 I assume this is not shared yet? But will be with
hcarmona 2015/04/13 21:13:24 Correct. Not shared yet, but it's in a state where
8 #include "base/command_line.h"
groby-ooo-7-16 2015/04/08 18:39:15 Just forward declare CommandLine
hcarmona 2015/04/10 18:54:08 Done.
9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/ui/website_settings/permission_bubble_view.h"
11
12 class PermissionBubbleRequest;
13 class Browser;
14
15 // TestPermissionBubbleViewDelegate ////////////////////////////////////////////
groby-ooo-7-16 2015/04/08 18:39:15 Please don't add separator comments.
hcarmona 2015/04/10 18:54:07 Done.
16
17 class TestPermissionBubbleViewDelegate : public PermissionBubbleView::Delegate {
hcarmona 2015/04/07 01:02:47 Had to bring this class back. testing::NiceMock do
groby-ooo-7-16 2015/04/08 18:39:15 Acknowledged.
18 public:
19 TestPermissionBubbleViewDelegate();
20
21 void ToggleAccept(int, bool) override {}
22 void Accept() override {}
23 void Deny() override {}
24 void Closing() override {}
25 void SetView(PermissionBubbleView*) override {}
26
27 private:
28 DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate);
29 };
30
31 // PermissionBubbleBrowsertest /////////////////////////////////////////////////
32 // Use this class to test on a default window.
33
34 // Inherit from ExtensionBrowserTest instead of InProcessBrowserTest because
35 // testing app mode requires extensions.
36 class PermissionBubbleBrowsertest : public ExtensionBrowserTest {
37 public:
38 PermissionBubbleBrowsertest();
39 ~PermissionBubbleBrowsertest() override;
40
41 void SetUpOnMainThread() override;
42
43 std::vector<PermissionBubbleRequest*> requests() { return requests_.get(); }
44 std::vector<bool> accept_states() { return accept_states_; }
45 PermissionBubbleView::Delegate* test_delegate() { return &test_delegate_; }
46
47 private:
48 TestPermissionBubbleViewDelegate test_delegate_;
49 ScopedVector<PermissionBubbleRequest> requests_;
50 std::vector<bool> accept_states_;
51 };
52
53 // PermissionBubbleAppBrowsertest //////////////////////////////////////////////
54 // Use this class to test on an app window.
55
56 class PermissionBubbleAppBrowsertest : public PermissionBubbleBrowsertest {
57 public:
58 PermissionBubbleAppBrowsertest();
59 ~PermissionBubbleAppBrowsertest() override;
60
61 void SetUpOnMainThread() override;
62
63 Browser* app_browser() { return app_browser_; }
64
65 private:
66 Browser* app_browser_;
67
68 Browser* OpenExtensionAppWindow(const extensions::Extension* extension);
69 };
70
71 // PermissionBubbleKioskBrowsertest ////////////////////////////////////////////
72 // Use this class to test on a kiosk window.
groby-ooo-7-16 2015/04/08 18:39:15 Class comments go directly on top of class. Also,
hcarmona 2015/04/10 18:54:08 Done.
73
74 class PermissionBubbleKioskBrowsertest : public PermissionBubbleBrowsertest {
75 public:
76 PermissionBubbleKioskBrowsertest();
77 ~PermissionBubbleKioskBrowsertest() override;
78
79 void SetUpCommandLine(base::CommandLine* command_line) override;
80 };
81
82 #endif // CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSERTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698