| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 ExtensionMessageBubbleBrowserTest(); | 25 ExtensionMessageBubbleBrowserTest(); |
| 26 ~ExtensionMessageBubbleBrowserTest() override; | 26 ~ExtensionMessageBubbleBrowserTest() override; |
| 27 | 27 |
| 28 // BrowserActionsBarBrowserTest: | 28 // BrowserActionsBarBrowserTest: |
| 29 void SetUpCommandLine(base::CommandLine* command_line) override; | 29 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 30 void TearDownOnMainThread() override; | 30 void TearDownOnMainThread() override; |
| 31 | 31 |
| 32 // Checks the position of the bubble present in the given |browser|, when the | 32 // Checks the position of the bubble present in the given |browser|, when the |
| 33 // bubble should be anchored at the given |anchor|. | 33 // bubble should be anchored at the given |anchor| and that the toolbar model |
| 34 virtual void CheckBubble(Browser* browser, AnchorPosition anchor) = 0; | 34 // is correctly highlighting. |
| 35 void CheckBubble(Browser* browser, |
| 36 AnchorPosition anchor, |
| 37 bool should_be_highlighting); |
| 38 // Performs the platform-specific checks. |
| 39 virtual void CheckBubbleNative(Browser* browser, AnchorPosition anchor) = 0; |
| 35 | 40 |
| 36 // Closes the bubble present in the given |browser|. | 41 // Closes the bubble present in the given |browser|. |
| 37 virtual void CloseBubble(Browser* browser) = 0; | 42 void CloseBubble(Browser* browser); |
| 43 // Performs the platform-specific close. |
| 44 virtual void CloseBubbleNative(Browser* browser) = 0; |
| 38 | 45 |
| 39 // Checks that there is no active bubble for the given |browser|. | 46 // Checks that there is no active bubble for the given |browser|. |
| 40 virtual void CheckBubbleIsNotPresent(Browser* browser) = 0; | 47 // We specify whether or not the toolbar model should be highlighting or there |
| 48 // is a bubble active since another browser window may have an active bubble. |
| 49 void CheckBubbleIsNotPresent(Browser* browser, |
| 50 bool should_profile_have_bubble, |
| 51 bool should_be_highlighting); |
| 52 // Performs the platform-specific checks. |
| 53 virtual void CheckBubbleIsNotPresentNative(Browser* browser) = 0; |
| 41 | 54 |
| 42 // Adds a new extension that uses the chrome_settings_overrides api to | 55 // Adds a new extension that uses the chrome_settings_overrides api to |
| 43 // override a setting specified in |settings_override_value|. | 56 // override a setting specified in |settings_override_value|. |
| 44 void AddSettingsOverrideExtension(const std::string& settings_override_value); | 57 void AddSettingsOverrideExtension(const std::string& settings_override_value); |
| 45 | 58 |
| 46 // The following are essentially the different tests, but we can't define the | 59 // The following are essentially the different tests, but we can't define the |
| 47 // tests in this file, since it relies on platform-specific implementation | 60 // tests in this file, since it relies on platform-specific implementation |
| 48 // (the above virtual methods). | 61 // (the above virtual methods). |
| 49 | 62 |
| 50 // Tests that an extension bubble will be anchored to an extension action when | 63 // Tests that an extension bubble will be anchored to an extension action when |
| (...skipping 30 matching lines...) Expand all Loading... |
| 81 void TestControlledNewTabPageBubbleShown(); | 94 void TestControlledNewTabPageBubbleShown(); |
| 82 | 95 |
| 83 // Tests that the bubble indicating an extension is controlling a user's | 96 // Tests that the bubble indicating an extension is controlling a user's |
| 84 // home page is shown. | 97 // home page is shown. |
| 85 void TestControlledHomeBubbleShown(); | 98 void TestControlledHomeBubbleShown(); |
| 86 | 99 |
| 87 // Tests that the bubble indicating an extension is controlling a user's | 100 // Tests that the bubble indicating an extension is controlling a user's |
| 88 // search engine is shown. | 101 // search engine is shown. |
| 89 void TestControlledSearchBubbleShown(); | 102 void TestControlledSearchBubbleShown(); |
| 90 | 103 |
| 104 // Tests that having multiple windows, all of which could be vying to show a |
| 105 // warning bubble, behaves properly. |
| 106 void TestBubbleWithMultipleWindows(); |
| 107 |
| 91 private: | 108 private: |
| 92 std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> | 109 std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> |
| 93 dev_mode_bubble_override_; | 110 dev_mode_bubble_override_; |
| 94 | 111 |
| 95 // The backing directory for a custom extension loaded during a test. Null if | 112 // The backing directory for a custom extension loaded during a test. Null if |
| 96 // no custom extension is loaded. | 113 // no custom extension is loaded. |
| 97 std::unique_ptr<extensions::TestExtensionDir> custom_extension_dir_; | 114 std::unique_ptr<extensions::TestExtensionDir> custom_extension_dir_; |
| 98 | 115 |
| 99 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBrowserTest); | 116 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBrowserTest); |
| 100 }; | 117 }; |
| 101 | 118 |
| 102 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_ | 119 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BROWSERTEST_H_ |
| OLD | NEW |