| 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/shell_window_registry.h" | 8 #include "apps/shell_window_registry.h" |
| 9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const Extension* PlatformAppBrowserTest::LoadAndLaunchPlatformApp( | 58 const Extension* PlatformAppBrowserTest::LoadAndLaunchPlatformApp( |
| 59 const char* name) { | 59 const char* name) { |
| 60 content::WindowedNotificationObserver app_loaded_observer( | 60 content::WindowedNotificationObserver app_loaded_observer( |
| 61 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 61 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 62 content::NotificationService::AllSources()); | 62 content::NotificationService::AllSources()); |
| 63 | 63 |
| 64 const Extension* extension = LoadExtension( | 64 const Extension* extension = LoadExtension( |
| 65 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name)); | 65 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name)); |
| 66 EXPECT_TRUE(extension); | 66 EXPECT_TRUE(extension); |
| 67 | 67 |
| 68 OpenApplication(AppLaunchParams(browser()->profile(), extension, LAUNCH_NONE, | 68 OpenApplication(AppLaunchParams( |
| 69 NEW_WINDOW)); | 69 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW)); |
| 70 | 70 |
| 71 app_loaded_observer.Wait(); | 71 app_loaded_observer.Wait(); |
| 72 | 72 |
| 73 return extension; | 73 return extension; |
| 74 } | 74 } |
| 75 | 75 |
| 76 const Extension* PlatformAppBrowserTest::InstallPlatformApp( | 76 const Extension* PlatformAppBrowserTest::InstallPlatformApp( |
| 77 const char* name) { | 77 const char* name) { |
| 78 const Extension* extension = InstallExtension( | 78 const Extension* extension = InstallExtension( |
| 79 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name), 1); | 79 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name), 1); |
| 80 EXPECT_TRUE(extension); | 80 EXPECT_TRUE(extension); |
| 81 | 81 |
| 82 return extension; | 82 return extension; |
| 83 } | 83 } |
| 84 | 84 |
| 85 const Extension* PlatformAppBrowserTest::InstallAndLaunchPlatformApp( | 85 const Extension* PlatformAppBrowserTest::InstallAndLaunchPlatformApp( |
| 86 const char* name) { | 86 const char* name) { |
| 87 content::WindowedNotificationObserver app_loaded_observer( | 87 content::WindowedNotificationObserver app_loaded_observer( |
| 88 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 88 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 89 content::NotificationService::AllSources()); | 89 content::NotificationService::AllSources()); |
| 90 | 90 |
| 91 const Extension* extension = InstallPlatformApp(name); | 91 const Extension* extension = InstallPlatformApp(name); |
| 92 | 92 |
| 93 OpenApplication(AppLaunchParams(browser()->profile(), extension, LAUNCH_NONE, | 93 OpenApplication(AppLaunchParams( |
| 94 NEW_WINDOW)); | 94 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW)); |
| 95 | 95 |
| 96 app_loaded_observer.Wait(); | 96 app_loaded_observer.Wait(); |
| 97 | 97 |
| 98 return extension; | 98 return extension; |
| 99 } | 99 } |
| 100 | 100 |
| 101 WebContents* PlatformAppBrowserTest::GetFirstShellWindowWebContents() { | 101 WebContents* PlatformAppBrowserTest::GetFirstShellWindowWebContents() { |
| 102 ShellWindow* window = GetFirstShellWindow(); | 102 ShellWindow* window = GetFirstShellWindow(); |
| 103 if (window) | 103 if (window) |
| 104 return window->web_contents(); | 104 return window->web_contents(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 bounds); | 193 bounds); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 196 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
| 197 CommandLine* command_line) { | 197 CommandLine* command_line) { |
| 198 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 198 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 199 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 199 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace extensions | 202 } // namespace extensions |
| OLD | NEW |