#ifndef CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_
#define CHROME_BROWSER_APPS_APP_BROWSERTEST_UTIL_H_
#include "apps/app_window.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "content/public/common/page_transition_types.h"
namespace base {
class CommandLine;
}
namespace content {
class WebContents;
}
class Browser;
namespace extensions {
class Extension;
class PlatformAppBrowserTest : public ExtensionApiTest {
public:
PlatformAppBrowserTest();
virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
static apps::AppWindow* GetFirstAppWindowForBrowser(Browser* browser);
protected:
const Extension* LoadAndLaunchPlatformApp(const char* name);
const Extension* InstallPlatformApp(const char* name);
const Extension* InstallAndLaunchPlatformApp(const char* name);
void LaunchPlatformApp(const Extension* extension);
content::WebContents* GetFirstAppWindowWebContents();
apps::AppWindow* GetFirstAppWindow();
apps::AppWindow* GetFirstAppWindowForApp(const std::string& app_id);
size_t RunGetWindowsFunctionForExtension(const Extension* extension);
bool RunGetWindowFunctionForExtension(int window_id,
const Extension* extension);
size_t GetAppWindowCount();
size_t GetAppWindowCountForApp(const std::string& app_id);
void ClearCommandLineArgs();
void SetCommandLineArg(const std::string& test_file);
apps::AppWindow* CreateAppWindow(const Extension* extension);
apps::AppWindow* CreateAppWindowFromParams(
const Extension* extension,
const apps::AppWindow::CreateParams& params);
void CloseAppWindow(apps::AppWindow* window);
void CallAdjustBoundsToBeVisibleOnScreenForAppWindow(
apps::AppWindow* window,
const gfx::Rect& cached_bounds,
const gfx::Rect& cached_screen_bounds,
const gfx::Rect& current_screen_bounds,
const gfx::Size& minimum_size,
gfx::Rect* bounds);
apps::AppWindow* CreateTestAppWindow(
const std::string& window_create_options);
};
class ExperimentalPlatformAppBrowserTest : public PlatformAppBrowserTest {
public:
virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
};
}
#endif