| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 | 10 |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 } | 14 } |
| 15 | 15 |
| 16 class CommandLine; | 16 class CommandLine; |
| 17 class ShellWindow; | 17 class ShellWindow; |
| 18 | 18 |
| 19 namespace extensions { | 19 namespace extensions { |
| 20 class Extension; | 20 class Extension; |
| 21 | 21 |
| 22 class PlatformAppBrowserTest : public ExtensionApiTest { | 22 class PlatformAppBrowserTest : public ExtensionApiTest { |
| 23 public: | 23 public: |
| 24 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 24 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 // Runs the app named |name| out of the platform_apps subdirectory. Waits | 27 // Runs the app named |name| out of the platform_apps subdirectory. Waits |
| 28 // until it is launched. | 28 // until it is launched. |
| 29 const Extension* LoadAndLaunchPlatformApp(const char* name); | 29 static const Extension* LoadAndLaunchPlatformApp( |
| 30 Browser* browser, NotificationObserver* observer, |
| 31 FilePath test_data_dir_, const char* name); |
| 32 const Extension* LoadAndLaunchPlatformApp(const char* name) { |
| 33 return LoadAndLaunchPlatformApp(browser(), this, test_data_dir_, name); |
| 34 } |
| 30 | 35 |
| 31 // Installs and runs the app named |name| out of the platform_apps | 36 // Installs and runs the app named |name| out of the platform_apps |
| 32 // subdirectory. Waits until it is launched. | 37 // subdirectory. Waits until it is launched. |
| 33 const Extension* InstallAndLaunchPlatformApp(const char* name); | 38 const Extension* InstallAndLaunchPlatformApp(const char* name); |
| 34 | 39 |
| 35 // Gets the WebContents associated with the first shell window that is found | 40 // Gets the WebContents associated with the first shell window that is found |
| 36 // (most tests only deal with one platform app window, so this is good | 41 // (most tests only deal with one platform app window, so this is good |
| 37 // enough). | 42 // enough). |
| 38 content::WebContents* GetFirstShellWindowWebContents(); | 43 content::WebContents* GetFirstShellWindowWebContents(); |
| 39 | 44 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 64 // Creates an empty shell window for |extension|. | 69 // Creates an empty shell window for |extension|. |
| 65 ShellWindow* CreateShellWindow(const Extension* extension); | 70 ShellWindow* CreateShellWindow(const Extension* extension); |
| 66 | 71 |
| 67 // Closes |window| and waits until it's gone. | 72 // Closes |window| and waits until it's gone. |
| 68 void CloseShellWindow(ShellWindow* window); | 73 void CloseShellWindow(ShellWindow* window); |
| 69 }; | 74 }; |
| 70 | 75 |
| 71 } | 76 } |
| 72 | 77 |
| 73 #endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ | 78 #endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ |
| OLD | NEW |