| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", | 260 EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", |
| 261 browser()->GetTabContentsAt(2)->controller(). | 261 browser()->GetTabContentsAt(2)->controller(). |
| 262 GetLastCommittedEntry()->url().path()); | 262 GetLastCommittedEntry()->url().path()); |
| 263 RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); | 263 RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); |
| 264 EXPECT_EQ(host->process(), | 264 EXPECT_EQ(host->process(), |
| 265 browser()->GetTabContentsAt(2)->render_view_host()->process()); | 265 browser()->GetTabContentsAt(2)->render_view_host()->process()); |
| 266 } | 266 } |
| 267 | 267 |
| 268 // Ensure that reloading a URL after installing or uninstalling it as an app | 268 // Ensure that reloading a URL after installing or uninstalling it as an app |
| 269 // correctly swaps the process. (http://crbug.com/80621) | 269 // correctly swaps the process. (http://crbug.com/80621) |
| 270 IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcess) { | 270 // Disabled until we get a correct fix for 80621. See http://crbug.com/102408. |
| 271 IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { |
| 271 CommandLine::ForCurrentProcess()->AppendSwitch( | 272 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 272 switches::kDisablePopupBlocking); | 273 switches::kDisablePopupBlocking); |
| 273 | 274 |
| 274 ExtensionProcessManager* extension_process_manager = | 275 ExtensionProcessManager* extension_process_manager = |
| 275 browser()->profile()->GetExtensionProcessManager(); | 276 browser()->profile()->GetExtensionProcessManager(); |
| 276 | 277 |
| 277 host_resolver()->AddRule("*", "127.0.0.1"); | 278 host_resolver()->AddRule("*", "127.0.0.1"); |
| 278 ASSERT_TRUE(test_server()->Start()); | 279 ASSERT_TRUE(test_server()->Start()); |
| 279 | 280 |
| 280 // The app under test acts on URLs whose host is "localhost", | 281 // The app under test acts on URLs whose host is "localhost", |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 content::NOTIFICATION_LOAD_STOP, | 342 content::NOTIFICATION_LOAD_STOP, |
| 342 Source<NavigationController>( | 343 Source<NavigationController>( |
| 343 &browser()->GetSelectedTabContentsWrapper()->controller())); | 344 &browser()->GetSelectedTabContentsWrapper()->controller())); |
| 344 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->render_view_host(), | 345 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->render_view_host(), |
| 345 L"", L"location.reload();")); | 346 L"", L"location.reload();")); |
| 346 js_reload_observer2.Wait(); | 347 js_reload_observer2.Wait(); |
| 347 EXPECT_FALSE(extension_process_manager->IsExtensionProcess( | 348 EXPECT_FALSE(extension_process_manager->IsExtensionProcess( |
| 348 contents->render_view_host()->process()->id())); | 349 contents->render_view_host()->process()->id())); |
| 349 } | 350 } |
| 350 | 351 |
| 351 | |
| 352 // Tests that if we have a non-app process (path3/container.html) that has an | 352 // Tests that if we have a non-app process (path3/container.html) that has an |
| 353 // iframe with a URL in the app's extent (path1/iframe.html), then opening a | 353 // iframe with a URL in the app's extent (path1/iframe.html), then opening a |
| 354 // link from that iframe to a new window to a URL in the app's extent (path1/ | 354 // link from that iframe to a new window to a URL in the app's extent (path1/ |
| 355 // empty.html) results in the new window being in an app process. See | 355 // empty.html) results in the new window being in an app process. See |
| 356 // http://crbug.com/89272 for more details. | 356 // http://crbug.com/89272 for more details. |
| 357 IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { | 357 IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { |
| 358 CommandLine::ForCurrentProcess()->AppendSwitch( | 358 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 359 switches::kDisablePopupBlocking); | 359 switches::kDisablePopupBlocking); |
| 360 | 360 |
| 361 ExtensionProcessManager* extension_process_manager = | 361 ExtensionProcessManager* extension_process_manager = |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 Source<NavigationController>( | 484 Source<NavigationController>( |
| 485 &browser()->GetSelectedTabContentsWrapper()->controller())); | 485 &browser()->GetSelectedTabContentsWrapper()->controller())); |
| 486 browser()->Reload(CURRENT_TAB); | 486 browser()->Reload(CURRENT_TAB); |
| 487 observer.Wait(); | 487 observer.Wait(); |
| 488 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 488 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 489 contents->render_view_host(), L"", | 489 contents->render_view_host(), L"", |
| 490 L"window.domAutomationController.send(chrome.app.isInstalled)", | 490 L"window.domAutomationController.send(chrome.app.isInstalled)", |
| 491 &is_installed)); | 491 &is_installed)); |
| 492 ASSERT_TRUE(is_installed); | 492 ASSERT_TRUE(is_installed); |
| 493 } | 493 } |
| OLD | NEW |