Index: chrome/browser/ui/test/permission_bubble_browser_test_util.h |
diff --git a/chrome/browser/ui/test/permission_bubble_browser_test_util.h b/chrome/browser/ui/test/permission_bubble_browser_test_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..28a3c32f44090e6d820a1779601e4432e86997dc |
--- /dev/null |
+++ b/chrome/browser/ui/test/permission_bubble_browser_test_util.h |
@@ -0,0 +1,76 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
groby-ooo-7-16
2015/04/10 20:58:56
File belongs into c/b/ui/website_settings, since i
hcarmona
2015/04/10 22:28:05
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_ |
+#define CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_ |
+ |
+#include "chrome/browser/extensions/extension_browsertest.h" |
+#include "chrome/browser/ui/website_settings/permission_bubble_view.h" |
+ |
+namespace base { |
+class CommandLine; |
+} |
+class PermissionBubbleRequest; |
+class Browser; |
+ |
+class TestPermissionBubbleViewDelegate : public PermissionBubbleView::Delegate { |
+ public: |
+ TestPermissionBubbleViewDelegate(); |
groby-ooo-7-16
2015/04/10 20:58:55
empty ctor here. (See below)
hcarmona
2015/04/10 22:28:05
Acknowledged.
|
+ |
+ void ToggleAccept(int, bool) override {} |
+ void Accept() override {} |
+ void Deny() override {} |
+ void Closing() override {} |
+ void SetView(PermissionBubbleView*) override {} |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate); |
+}; |
+ |
+// Use this class to test on a default window. |
+// Inherit from ExtensionBrowserTest instead of InProcessBrowserTest because |
+// testing app mode requires extensions. |
+class PermissionBubbleBrowsertest : public ExtensionBrowserTest { |
+ public: |
+ PermissionBubbleBrowsertest(); |
groby-ooo-7-16
2015/04/10 20:58:56
Just define an empty ctor inline - you're not doin
hcarmona
2015/04/10 22:28:05
Can't do that b/c these classes are considered com
groby-ooo-7-16
2015/04/10 23:00:33
Sigh. You're right - I forgot that any templated m
|
+ ~PermissionBubbleBrowsertest() override; |
groby-ooo-7-16
2015/04/10 20:58:56
Same goes for dtor
hcarmona
2015/04/10 22:28:05
Acknowledged.
|
+ |
+ void SetUpOnMainThread() override; |
+ |
+ std::vector<PermissionBubbleRequest*> requests() { return requests_.get(); } |
+ std::vector<bool> accept_states() { return accept_states_; } |
+ PermissionBubbleView::Delegate* test_delegate() { return &test_delegate_; } |
+ |
+ private: |
+ TestPermissionBubbleViewDelegate test_delegate_; |
+ ScopedVector<PermissionBubbleRequest> requests_; |
+ std::vector<bool> accept_states_; |
+}; |
+ |
+// Use this class to test on an app window. |
+class PermissionBubbleAppBrowsertest : public PermissionBubbleBrowsertest { |
+ public: |
+ PermissionBubbleAppBrowsertest(); |
+ ~PermissionBubbleAppBrowsertest() override; |
+ |
+ void SetUpOnMainThread() override; |
+ |
+ Browser* app_browser() { return app_browser_; } |
+ |
+ private: |
+ Browser* app_browser_; |
+ |
+ Browser* OpenExtensionAppWindow(const extensions::Extension* extension); |
+}; |
+ |
+// Use this class to test on a kiosk window. |
+class PermissionBubbleKioskBrowsertest : public PermissionBubbleBrowsertest { |
+ public: |
+ PermissionBubbleKioskBrowsertest(); |
groby-ooo-7-16
2015/04/10 20:58:55
empty ctor here.
hcarmona
2015/04/10 22:28:05
Acknowledged.
|
+ ~PermissionBubbleKioskBrowsertest() override; |
+ |
+ void SetUpCommandLine(base::CommandLine* command_line) override; |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_ |