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

Unified Diff: chrome/browser/ui/website_settings/permission_bubble_browser_test_util.h

Issue 1275623004: [Extensions] Expand testing overrides for extension warning bubbles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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/website_settings/permission_bubble_browser_test_util.h
diff --git a/chrome/browser/ui/website_settings/permission_bubble_browser_test_util.h b/chrome/browser/ui/website_settings/permission_bubble_browser_test_util.h
index ee34f301793d7a93abbb3fbcc3c474c48d189e9b..aed83ef524e5085ba80c6938aeb21ac202b30754 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_browser_test_util.h
+++ b/chrome/browser/ui/website_settings/permission_bubble_browser_test_util.h
@@ -27,14 +27,19 @@ class TestPermissionBubbleViewDelegate : public PermissionBubbleView::Delegate {
DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate);
};
-// Use this class to test on a default window.
-class PermissionBubbleBrowserTest : public virtual InProcessBrowserTest {
+// Use this class to test on a default window or an app window. Inheriting from
+// ExtensionBrowserTest allows us to easily load and launch apps, and doesn't
+// really add any extra work.
+class PermissionBubbleBrowserTest : public ExtensionBrowserTest {
public:
PermissionBubbleBrowserTest();
~PermissionBubbleBrowserTest() override;
void SetUpOnMainThread() override;
+ // Opens an app window, and returns the associated browser.
+ Browser* OpenExtensionAppWindow();
+
std::vector<PermissionBubbleRequest*> requests() { return requests_.get(); }
std::vector<bool> accept_states() { return accept_states_; }
PermissionBubbleView::Delegate* test_delegate() { return &test_delegate_; }
@@ -43,27 +48,8 @@ class PermissionBubbleBrowserTest : public virtual InProcessBrowserTest {
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 ExtensionBrowserTest {
- public:
- PermissionBubbleAppBrowserTest();
- ~PermissionBubbleAppBrowserTest() override;
-
- void SetUpOnMainThread() override;
- // Override from ExtensionBrowserTest to avoid "inheritance via dominance".
- void SetUp() override;
- void SetUpCommandLine(base::CommandLine* command_line) override;
-
- Browser* app_browser() { return app_browser_; }
-
- private:
- Browser* app_browser_;
-
- Browser* OpenExtensionAppWindow(const extensions::Extension* extension);
+ DISALLOW_COPY_AND_ASSIGN(PermissionBubbleBrowserTest);
};
// Use this class to test on a kiosk window.
@@ -73,6 +59,8 @@ class PermissionBubbleKioskBrowserTest : public PermissionBubbleBrowserTest {
~PermissionBubbleKioskBrowserTest() override;
void SetUpCommandLine(base::CommandLine* command_line) override;
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionBubbleKioskBrowserTest);
};
#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698