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

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

Issue 8565016: Merge 108571 - Don't reload into an app process. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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 }
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