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 <string> | 5 #include <string> |
6 | 6 |
7 #include <shlobj.h> // Must be before propkey. | 7 #include <shlobj.h> // Must be before propkey. |
8 #include <propkey.h> | 8 #include <propkey.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 | 10 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 239 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
240 return; | 240 return; |
241 | 241 |
242 // Load an app. | 242 // Load an app. |
243 const extensions::Extension* extension = | 243 const extensions::Extension* extension = |
244 LoadExtension(test_data_dir_.AppendASCII("app/")); | 244 LoadExtension(test_data_dir_.AppendASCII("app/")); |
245 EXPECT_TRUE(extension); | 245 EXPECT_TRUE(extension); |
246 | 246 |
247 OpenApplication(AppLaunchParams( | 247 OpenApplication(AppLaunchParams( |
248 browser()->profile(), extension, extensions::LAUNCH_CONTAINER_WINDOW, | 248 browser()->profile(), extension, extensions::LAUNCH_CONTAINER_WINDOW, |
249 NEW_FOREGROUND_TAB, extensions::SOURCE_UNTRACKED)); | 249 NEW_FOREGROUND_TAB, extensions::SOURCE_BROWSER_TEST)); |
250 | 250 |
251 // Check that the new browser has an app name. | 251 // Check that the new browser has an app name. |
252 // The launch should have created a new browser. | 252 // The launch should have created a new browser. |
253 ASSERT_EQ(2u, | 253 ASSERT_EQ(2u, |
254 chrome::GetBrowserCount(browser()->profile(), | 254 chrome::GetBrowserCount(browser()->profile(), |
255 browser()->host_desktop_type())); | 255 browser()->host_desktop_type())); |
256 | 256 |
257 // Find the new browser. | 257 // Find the new browser. |
258 Browser* app_browser = nullptr; | 258 Browser* app_browser = nullptr; |
259 for (chrome::BrowserIterator it; !it.done() && !app_browser; it.Next()) { | 259 for (chrome::BrowserIterator it; !it.done() && !app_browser; it.Next()) { |
260 if (*it != browser()) | 260 if (*it != browser()) |
261 app_browser = *it; | 261 app_browser = *it; |
262 } | 262 } |
263 ASSERT_TRUE(app_browser); | 263 ASSERT_TRUE(app_browser); |
264 ASSERT_TRUE(app_browser != browser()); | 264 ASSERT_TRUE(app_browser != browser()); |
265 | 265 |
266 WaitAndValidateBrowserWindowProperties( | 266 WaitAndValidateBrowserWindowProperties( |
267 base::Bind(&ValidateHostedAppWindowProperties, app_browser, extension)); | 267 base::Bind(&ValidateHostedAppWindowProperties, app_browser, extension)); |
268 } | 268 } |
OLD | NEW |