[Extensions Mac] Add tests for the mac developer mode warning
[chromium-blink-merge.git] / chrome / browser / ui / extensions / extension_message_bubble_browsertest.h
blob1552130fa1ce5b2c4d6f56dba93ea08731a087ad
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.
5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h"
12 class ExtensionMessageBubbleBrowserTest
13 : public BrowserActionsBarBrowserTest {
14 protected:
15 enum AnchorPosition {
16 ANCHOR_BROWSER_ACTION,
17 ANCHOR_WRENCH_MENU,
20 ExtensionMessageBubbleBrowserTest();
21 ~ExtensionMessageBubbleBrowserTest() override;
23 // BrowserActionsBarBrowserTest:
24 void SetUpCommandLine(base::CommandLine* command_line) override;
26 // Checks the position of the bubble present in the given |browser|, when the
27 // bubble should be anchored at the given |anchor|.
28 virtual void CheckBubble(Browser* browser, AnchorPosition anchor) = 0;
30 // Closes the bubble present in the given |browser|.
31 virtual void CloseBubble(Browser* browser) = 0;
33 // The following are essentially the different tests, but we can't define the
34 // tests in this file, since it relies on platform-specific implementation
35 // (the above virtual methods).
37 // Tests that an extension bubble will be anchored to an extension action when
38 // there are extensions with actions.
39 void TestBubbleAnchoredToExtensionAction();
41 // Tests that an extension bubble will be anchored to the wrench menu when
42 // there aren't any extensions with actions.
43 // This also tests that the crashes in crbug.com/476426 are fixed.
44 void TestBubbleAnchoredToWrenchMenu();
46 // Tests that the extension bubble will show on startup.
47 void PreBubbleShowsOnStartup();
48 void TestBubbleShowsOnStartup();
50 private:
51 scoped_ptr<extensions::FeatureSwitch::ScopedOverride>
52 dev_mode_bubble_override_;
54 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBrowserTest);
57 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_