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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // platform app shell window that is found (most tests only deal with one | 102 // platform app shell window that is found (most tests only deal with one |
103 // platform app window, so this is good enough). | 103 // platform app window, so this is good enough). |
104 WebContents* GetFirstPlatformAppShellWindowWebContents() { | 104 WebContents* GetFirstPlatformAppShellWindowWebContents() { |
105 ExtensionProcessManager* process_manager = | 105 ExtensionProcessManager* process_manager = |
106 browser()->profile()->GetExtensionProcessManager(); | 106 browser()->profile()->GetExtensionProcessManager(); |
107 ExtensionProcessManager::const_iterator iter; | 107 ExtensionProcessManager::const_iterator iter; |
108 ExtensionProcessManager::ExtensionHostSet platform_app_hosts = | 108 ExtensionProcessManager::ExtensionHostSet platform_app_hosts = |
109 process_manager->platform_app_hosts(); | 109 process_manager->platform_app_hosts(); |
110 for (iter = platform_app_hosts.begin(); iter != platform_app_hosts.end(); | 110 for (iter = platform_app_hosts.begin(); iter != platform_app_hosts.end(); |
111 ++iter) { | 111 ++iter) { |
112 return (*iter)->host_contents(); | 112 if ((*iter)->extension_host_type() == chrome::VIEW_TYPE_APP_SHELL) |
| 113 return (*iter)->host_contents(); |
113 } | 114 } |
114 | 115 |
115 return NULL; | 116 return NULL; |
116 } | 117 } |
117 }; | 118 }; |
118 | 119 |
119 // Tests that platform apps received the "launch" event when launched. | 120 // Tests that platform apps received the "launch" event when launched. |
120 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, OnLaunchedEvent) { | 121 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, OnLaunchedEvent) { |
121 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch")) << message_; | 122 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch")) << message_; |
122 } | 123 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 172 } |
172 | 173 |
173 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Restrictions) { | 174 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Restrictions) { |
174 ASSERT_TRUE(RunPlatformAppTest("platform_apps/restrictions")) << message_; | 175 ASSERT_TRUE(RunPlatformAppTest("platform_apps/restrictions")) << message_; |
175 } | 176 } |
176 | 177 |
177 // Tests that platform apps can use the chrome.windows.* API. | 178 // Tests that platform apps can use the chrome.windows.* API. |
178 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApi) { | 179 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApi) { |
179 ASSERT_TRUE(RunPlatformAppTest("platform_apps/windows_api")) << message_; | 180 ASSERT_TRUE(RunPlatformAppTest("platform_apps/windows_api")) << message_; |
180 } | 181 } |
OLD | NEW |