Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: chrome/browser/extensions/app_process_apitest.cc

Issue 8443005: Don't reload into an app process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge after revert. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 content::NOTIFICATION_LOAD_STOP, 363 content::NOTIFICATION_LOAD_STOP,
363 content::Source<NavigationController>( 364 content::Source<NavigationController>(
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
373 // Tests that if we have a non-app process (path3/container.html) that has an 373 // Tests that if we have a non-app process (path3/container.html) that has an
374 // iframe with a URL in the app's extent (path1/iframe.html), then opening a 374 // iframe with a URL in the app's extent (path1/iframe.html), then opening a
375 // link from that iframe to a new window to a URL in the app's extent (path1/ 375 // link from that iframe to a new window to a URL in the app's extent (path1/
376 // empty.html) results in the new window being in an app process. See 376 // empty.html) results in the new window being in an app process. See
377 // http://crbug.com/89272 for more details. 377 // http://crbug.com/89272 for more details.
378 IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { 378 IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) {
379 CommandLine::ForCurrentProcess()->AppendSwitch( 379 CommandLine::ForCurrentProcess()->AppendSwitch(
380 switches::kDisablePopupBlocking); 380 switches::kDisablePopupBlocking);
381 381
382 ExtensionProcessManager* extension_process_manager = 382 ExtensionProcessManager* extension_process_manager =
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 content::Source<NavigationController>( 513 content::Source<NavigationController>(
514 &browser()->GetSelectedTabContentsWrapper()->controller())); 514 &browser()->GetSelectedTabContentsWrapper()->controller()));
515 browser()->Reload(CURRENT_TAB); 515 browser()->Reload(CURRENT_TAB);
516 observer.Wait(); 516 observer.Wait();
517 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 517 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
518 contents->render_view_host(), L"", 518 contents->render_view_host(), L"",
519 L"window.domAutomationController.send(chrome.app.isInstalled)", 519 L"window.domAutomationController.send(chrome.app.isInstalled)",
520 &is_installed)); 520 &is_installed));
521 ASSERT_TRUE(is_installed); 521 ASSERT_TRUE(is_installed);
522 } 522 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698