| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APPS_APP_BROWSERTEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_ | 6 #define CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/extensions/extension_apitest.h" | 11 #include "chrome/browser/extensions/extension_apitest.h" |
| 12 #include "extensions/browser/app_window/app_window.h" | 12 #include "extensions/browser/app_window/app_window.h" |
| 13 | 13 |
| 14 #if defined(OS_CHROMEOS) |
| 15 #include "chrome/browser/media/router/mock_media_router.h" |
| 16 #endif |
| 17 |
| 14 namespace base { | 18 namespace base { |
| 15 class CommandLine; | 19 class CommandLine; |
| 16 } | 20 } |
| 17 | 21 |
| 18 namespace content { | 22 namespace content { |
| 19 class BrowserContext; | 23 class BrowserContext; |
| 20 class WebContents; | 24 class WebContents; |
| 21 } | 25 } |
| 22 | 26 |
| 23 class Browser; | 27 class Browser; |
| 24 class ExtensionTestMessageListener; | 28 class ExtensionTestMessageListener; |
| 25 | 29 |
| 26 namespace extensions { | 30 namespace extensions { |
| 27 class Extension; | 31 class Extension; |
| 28 | 32 |
| 29 class PlatformAppBrowserTest : public ExtensionApiTest { | 33 class PlatformAppBrowserTest : public ExtensionApiTest { |
| 30 public: | 34 public: |
| 31 PlatformAppBrowserTest(); | 35 PlatformAppBrowserTest(); |
| 32 | 36 |
| 33 void SetUpCommandLine(base::CommandLine* command_line) override; | 37 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 38 void SetUpInProcessBrowserTestFixture() override; |
| 39 void TearDownInProcessBrowserTestFixture() override; |
| 34 | 40 |
| 35 // Gets the first app window that is found for a given browser. | 41 // Gets the first app window that is found for a given browser. |
| 36 static AppWindow* GetFirstAppWindowForBrowser(Browser* browser); | 42 static AppWindow* GetFirstAppWindowForBrowser(Browser* browser); |
| 37 | 43 |
| 38 protected: | 44 protected: |
| 39 // Runs the app named |name| out of the platform_apps subdirectory. Waits | 45 // Runs the app named |name| out of the platform_apps subdirectory. Waits |
| 40 // for the provided listener to be satisifed. | 46 // for the provided listener to be satisifed. |
| 41 const Extension* LoadAndLaunchPlatformApp( | 47 const Extension* LoadAndLaunchPlatformApp( |
| 42 const char* name, | 48 const char* name, |
| 43 ExtensionTestMessageListener* listener); | 49 ExtensionTestMessageListener* listener); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 const gfx::Size& minimum_size, | 116 const gfx::Size& minimum_size, |
| 111 gfx::Rect* bounds); | 117 gfx::Rect* bounds); |
| 112 | 118 |
| 113 // Load a simple test app and create a window. The window must be closed by | 119 // Load a simple test app and create a window. The window must be closed by |
| 114 // the caller in order to terminate the test - use CloseAppWindow(). | 120 // the caller in order to terminate the test - use CloseAppWindow(). |
| 115 // |window_create_options| are the options that will be passed to | 121 // |window_create_options| are the options that will be passed to |
| 116 // chrome.app.window.create() in the test app. | 122 // chrome.app.window.create() in the test app. |
| 117 AppWindow* CreateTestAppWindow(const std::string& window_create_options); | 123 AppWindow* CreateTestAppWindow(const std::string& window_create_options); |
| 118 | 124 |
| 119 private: | 125 private: |
| 126 #if defined(OS_CHROMEOS) |
| 127 media_router::MockMediaRouter media_router_; |
| 128 #endif |
| 129 |
| 120 DISALLOW_COPY_AND_ASSIGN(PlatformAppBrowserTest); | 130 DISALLOW_COPY_AND_ASSIGN(PlatformAppBrowserTest); |
| 121 }; | 131 }; |
| 122 | 132 |
| 123 class ExperimentalPlatformAppBrowserTest : public PlatformAppBrowserTest { | 133 class ExperimentalPlatformAppBrowserTest : public PlatformAppBrowserTest { |
| 124 public: | 134 public: |
| 125 void SetUpCommandLine(base::CommandLine* command_line) override; | 135 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 126 }; | 136 }; |
| 127 | 137 |
| 128 } // namespace extensions | 138 } // namespace extensions |
| 129 | 139 |
| 130 #endif // CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_ | 140 #endif // CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_ |
| OLD | NEW |