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