| 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 #include "chrome/browser/apps/app_browsertest_util.h" | 5 #include "chrome/browser/apps/app_browsertest_util.h" |
| 6 | 6 |
| 7 #include "apps/app_window_contents.h" | 7 #include "apps/app_window_contents.h" |
| 8 #include "apps/native_app_window.h" | 8 #include "apps/native_app_window.h" |
| 9 #include "apps/shell_window_registry.h" | 9 #include "apps/shell_window_registry.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 chrome::OpenApplication(chrome::AppLaunchParams(browser()->profile(), | 53 chrome::OpenApplication(chrome::AppLaunchParams(browser()->profile(), |
| 54 extension, | 54 extension, |
| 55 extension_misc::LAUNCH_NONE, | 55 extension_misc::LAUNCH_NONE, |
| 56 NEW_WINDOW)); | 56 NEW_WINDOW)); |
| 57 | 57 |
| 58 app_loaded_observer.Wait(); | 58 app_loaded_observer.Wait(); |
| 59 | 59 |
| 60 return extension; | 60 return extension; |
| 61 } | 61 } |
| 62 | 62 |
| 63 const Extension* PlatformAppBrowserTest::InstallPlatformApp( | |
| 64 const char* name) { | |
| 65 const Extension* extension = InstallExtension( | |
| 66 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name), 1); | |
| 67 EXPECT_TRUE(extension); | |
| 68 | |
| 69 return extension; | |
| 70 } | |
| 71 | |
| 72 const Extension* PlatformAppBrowserTest::InstallAndLaunchPlatformApp( | 63 const Extension* PlatformAppBrowserTest::InstallAndLaunchPlatformApp( |
| 73 const char* name) { | 64 const char* name) { |
| 74 content::WindowedNotificationObserver app_loaded_observer( | 65 content::WindowedNotificationObserver app_loaded_observer( |
| 75 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 66 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 76 content::NotificationService::AllSources()); | 67 content::NotificationService::AllSources()); |
| 77 | 68 |
| 78 const Extension* extension = InstallPlatformApp(name); | 69 const Extension* extension = InstallExtension( |
| 70 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name), 1); |
| 71 EXPECT_TRUE(extension); |
| 79 | 72 |
| 80 chrome::OpenApplication(chrome::AppLaunchParams(browser()->profile(), | 73 chrome::OpenApplication(chrome::AppLaunchParams(browser()->profile(), |
| 81 extension, | 74 extension, |
| 82 extension_misc::LAUNCH_NONE, | 75 extension_misc::LAUNCH_NONE, |
| 83 NEW_WINDOW)); | 76 NEW_WINDOW)); |
| 84 | 77 |
| 85 app_loaded_observer.Wait(); | 78 app_loaded_observer.Wait(); |
| 86 | 79 |
| 87 return extension; | 80 return extension; |
| 88 } | 81 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 bounds); | 185 bounds); |
| 193 } | 186 } |
| 194 | 187 |
| 195 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 188 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
| 196 CommandLine* command_line) { | 189 CommandLine* command_line) { |
| 197 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 190 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 198 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 191 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 199 } | 192 } |
| 200 | 193 |
| 201 } // namespace extensions | 194 } // namespace extensions |
| OLD | NEW |