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 // Loads the app named |name| out of the platform_apps subdirectory. |
| 28 const Extension* LoadPlatformApp(const char* name); |
| 29 |
| 30 // Installs the app named |name| out of the platform_apps subdirectory. |
| 31 const Extension* InstallPlatformApp(const char* name); |
| 32 |
27 // Runs the app named |name| out of the platform_apps subdirectory. Waits | 33 // Runs the app named |name| out of the platform_apps subdirectory. Waits |
28 // until it is launched. | 34 // until it is launched. |
29 const Extension* LoadAndLaunchPlatformApp(const char* name); | 35 const Extension* LoadAndLaunchPlatformApp(const char* name); |
30 | 36 |
31 // Installs and runs the app named |name| out of the platform_apps | 37 // Installs and runs the app named |name| out of the platform_apps |
32 // subdirectory. Waits until it is launched. | 38 // subdirectory. Waits until it is launched. |
33 const Extension* InstallAndLaunchPlatformApp(const char* name); | 39 const Extension* InstallAndLaunchPlatformApp(const char* name); |
34 | 40 |
35 // Gets the WebContents associated with the first shell window that is found | 41 // 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 | 42 // (most tests only deal with one platform app window, so this is good |
(...skipping 19 matching lines...) Expand all Loading... |
56 // The command line already has an argument on it - about:blank, which | 62 // The command line already has an argument on it - about:blank, which |
57 // is set by InProcessBrowserTest::PrepareTestCommandLine. For platform app | 63 // is set by InProcessBrowserTest::PrepareTestCommandLine. For platform app |
58 // launch tests we need to clear this. | 64 // launch tests we need to clear this. |
59 void ClearCommandLineArgs(); | 65 void ClearCommandLineArgs(); |
60 | 66 |
61 // Sets up the command line for running platform apps. | 67 // Sets up the command line for running platform apps. |
62 void SetCommandLineArg(const std::string& test_file); | 68 void SetCommandLineArg(const std::string& test_file); |
63 | 69 |
64 // Creates an empty shell window for |extension|. | 70 // Creates an empty shell window for |extension|. |
65 ShellWindow* CreateShellWindow(const Extension* extension); | 71 ShellWindow* CreateShellWindow(const Extension* extension); |
66 | |
67 // Closes |window| and waits until it's gone. | |
68 void CloseShellWindow(ShellWindow* window); | |
69 }; | 72 }; |
70 | 73 |
71 } | 74 } |
72 | 75 |
73 #endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ | 76 #endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_ |
OLD | NEW |