Chromium Code Reviews| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", | 281 EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", |
| 282 browser()->GetTabContentsAt(2)->controller(). | 282 browser()->GetTabContentsAt(2)->controller(). |
| 283 GetLastCommittedEntry()->url().path()); | 283 GetLastCommittedEntry()->url().path()); |
| 284 RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); | 284 RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); |
| 285 EXPECT_EQ(host->process(), | 285 EXPECT_EQ(host->process(), |
| 286 browser()->GetTabContentsAt(2)->render_view_host()->process()); | 286 browser()->GetTabContentsAt(2)->render_view_host()->process()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 // Ensure that reloading a URL after installing or uninstalling it as an app | 289 // Ensure that reloading a URL after installing or uninstalling it as an app |
| 290 // correctly swaps the process. (http://crbug.com/80621) | 290 // correctly swaps the process. (http://crbug.com/80621) |
| 291 IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcess) { | 291 // Disabled until we get a correct fix for 80621. See http://crbug.com/102408. |
| 292 IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { | |
| 292 CommandLine::ForCurrentProcess()->AppendSwitch( | 293 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 293 switches::kDisablePopupBlocking); | 294 switches::kDisablePopupBlocking); |
| 294 | 295 |
| 295 ExtensionProcessManager* extension_process_manager = | 296 ExtensionProcessManager* extension_process_manager = |
| 296 browser()->profile()->GetExtensionProcessManager(); | 297 browser()->profile()->GetExtensionProcessManager(); |
| 297 | 298 |
| 298 host_resolver()->AddRule("*", "127.0.0.1"); | 299 host_resolver()->AddRule("*", "127.0.0.1"); |
| 299 ASSERT_TRUE(test_server()->Start()); | 300 ASSERT_TRUE(test_server()->Start()); |
| 300 | 301 |
| 301 // The app under test acts on URLs whose host is "localhost", | 302 // The app under test acts on URLs whose host is "localhost", |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 364 &browser()->GetSelectedTabContentsWrapper()->controller())); | 365 &browser()->GetSelectedTabContentsWrapper()->controller())); |
| 365 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->render_view_host(), | 366 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->render_view_host(), |
| 366 L"", L"location.reload();")); | 367 L"", L"location.reload();")); |
| 367 js_reload_observer2.Wait(); | 368 js_reload_observer2.Wait(); |
| 368 EXPECT_FALSE(extension_process_manager->IsExtensionProcess( | 369 EXPECT_FALSE(extension_process_manager->IsExtensionProcess( |
| 369 contents->render_view_host()->process()->id())); | 370 contents->render_view_host()->process()->id())); |
| 370 } | 371 } |
| 371 | 372 |
| 372 // Ensure that page_ids are handled correctly when we force a process swap | 373 // Ensure that page_ids are handled correctly when we force a process swap |
| 373 // for an installed or uninstalled app. (http://crbug.com/102408) | 374 // for an installed or uninstalled app. (http://crbug.com/102408) |
| 374 IN_PROC_BROWSER_TEST_F(AppApiTest, BackToAppProcess) { | 375 IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_BackToAppProcess) { |
|
Charlie Reis
2011/11/03 20:47:58
This test will disappear with the revert.
| |
| 375 ExtensionProcessManager* extension_process_manager = | 376 ExtensionProcessManager* extension_process_manager = |
| 376 browser()->profile()->GetExtensionProcessManager(); | 377 browser()->profile()->GetExtensionProcessManager(); |
| 377 | 378 |
| 378 host_resolver()->AddRule("*", "127.0.0.1"); | 379 host_resolver()->AddRule("*", "127.0.0.1"); |
| 379 ASSERT_TRUE(test_server()->Start()); | 380 ASSERT_TRUE(test_server()->Start()); |
| 380 | 381 |
| 381 // The app under test acts on URLs whose host is "localhost", | 382 // The app under test acts on URLs whose host is "localhost", |
| 382 // so the URLs we navigate to must have host "localhost". | 383 // so the URLs we navigate to must have host "localhost". |
| 383 GURL base_url = GetTestBaseURL("app_process"); | 384 GURL base_url = GetTestBaseURL("app_process"); |
| 384 | 385 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 content::Source<NavigationController>( | 566 content::Source<NavigationController>( |
| 566 &browser()->GetSelectedTabContentsWrapper()->controller())); | 567 &browser()->GetSelectedTabContentsWrapper()->controller())); |
| 567 browser()->Reload(CURRENT_TAB); | 568 browser()->Reload(CURRENT_TAB); |
| 568 observer.Wait(); | 569 observer.Wait(); |
| 569 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 570 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 570 contents->render_view_host(), L"", | 571 contents->render_view_host(), L"", |
| 571 L"window.domAutomationController.send(chrome.app.isInstalled)", | 572 L"window.domAutomationController.send(chrome.app.isInstalled)", |
| 572 &is_installed)); | 573 &is_installed)); |
| 573 ASSERT_TRUE(is_installed); | 574 ASSERT_TRUE(is_installed); |
| 574 } | 575 } |
| OLD | NEW |