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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/test/permission_bubble_browsertest.h
diff --git a/chrome/browser/ui/test/permission_bubble_browsertest.h b/chrome/browser/ui/test/permission_bubble_browsertest.h
new file mode 100644
index 0000000000000000000000000000000000000000..8967ac77dea5f374d90c5a38162141c336d36c08
--- /dev/null
+++ b/chrome/browser/ui/test/permission_bubble_browsertest.h
@@ -0,0 +1,82 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// 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_BROWSERTEST_H_
+#define CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSERTEST_H_
+
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
+#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.
+#include "chrome/browser/extensions/extension_browsertest.h"
+#include "chrome/browser/ui/website_settings/permission_bubble_view.h"
+
+class PermissionBubbleRequest;
+class Browser;
+
+// 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.
+
+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.
+ public:
+ TestPermissionBubbleViewDelegate();
+
+ void ToggleAccept(int, bool) override {}
+ void Accept() override {}
+ void Deny() override {}
+ void Closing() override {}
+ void SetView(PermissionBubbleView*) override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate);
+};
+
+// PermissionBubbleBrowsertest /////////////////////////////////////////////////
+// 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();
+ ~PermissionBubbleBrowsertest() override;
+
+ 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_;
+};
+
+// PermissionBubbleAppBrowsertest //////////////////////////////////////////////
+// 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);
+};
+
+// PermissionBubbleKioskBrowsertest ////////////////////////////////////////////
+// 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.
+
+class PermissionBubbleKioskBrowsertest : public PermissionBubbleBrowsertest {
+ public:
+ PermissionBubbleKioskBrowsertest();
+ ~PermissionBubbleKioskBrowsertest() override;
+
+ void SetUpCommandLine(base::CommandLine* command_line) override;
+};
+
+#endif // CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSERTEST_H_

Powered by Google App Engine
This is Rietveld 408576698