OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_BROWSER_ACTIONS_BAR_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_BROWSER_ACTIONS_BAR_BROWSERTEST_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/extensions/extension_browsertest.h" |
| 12 |
| 13 namespace extensions { |
| 14 class Extension; |
| 15 } |
| 16 |
| 17 class BrowserActionTestUtil; |
| 18 |
| 19 // A platform-independent browser test class for the browser actions bar. |
| 20 class BrowserActionsBarBrowserTest : public ExtensionBrowserTest { |
| 21 protected: |
| 22 BrowserActionsBarBrowserTest(); |
| 23 virtual ~BrowserActionsBarBrowserTest(); |
| 24 |
| 25 virtual void SetUpCommandLine(base::CommandLine* command_line) override; |
| 26 virtual void SetUpOnMainThread() override; |
| 27 virtual void TearDownOnMainThread() override; |
| 28 |
| 29 BrowserActionTestUtil* browser_actions_bar() { |
| 30 return browser_actions_bar_.get(); |
| 31 } |
| 32 |
| 33 // Creates three different extensions, each with a browser action, and adds |
| 34 // them to associated ExtensionService. These can then be accessed via |
| 35 // extension_[a|b|c](). |
| 36 void LoadExtensions(); |
| 37 |
| 38 const extensions::Extension* extension_a() const { |
| 39 return extension_a_.get(); |
| 40 } |
| 41 const extensions::Extension* extension_b() const { |
| 42 return extension_b_.get(); |
| 43 } |
| 44 const extensions::Extension* extension_c() const { |
| 45 return extension_c_.get(); |
| 46 } |
| 47 |
| 48 private: |
| 49 scoped_ptr<BrowserActionTestUtil> browser_actions_bar_; |
| 50 |
| 51 // Extensions with browser actions used for testing. |
| 52 scoped_refptr<const extensions::Extension> extension_a_; |
| 53 scoped_refptr<const extensions::Extension> extension_b_; |
| 54 scoped_refptr<const extensions::Extension> extension_c_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(BrowserActionsBarBrowserTest); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_UI_TOOLBAR_BROWSER_ACTIONS_BAR_BROWSERTEST_H_ |
OLD | NEW |