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

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

Issue 740813004: Use StopChildProcess instead of base::KillProcess to kill a renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments Created 6 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 // Wait on test messages to make sure the pages loaded. 395 // Wait on test messages to make sure the pages loaded.
396 for (size_t i = 0; i < listeners.size(); ++i) 396 for (size_t i = 0; i < listeners.size(); ++i)
397 ASSERT_TRUE(listeners[i]->WaitUntilSatisfied()); 397 ASSERT_TRUE(listeners[i]->WaitUntilSatisfied());
398 398
399 // Crash the extension. 399 // Crash the extension.
400 extensions::ExtensionHost* extension_host = 400 extensions::ExtensionHost* extension_host =
401 extensions::ProcessManager::Get(browser()->profile()) 401 extensions::ProcessManager::Get(browser()->profile())
402 ->GetBackgroundHostForExtension(extension->id()); 402 ->GetBackgroundHostForExtension(extension->id());
403 ASSERT_TRUE(extension_host); 403 ASSERT_TRUE(extension_host);
404 base::KillProcess(extension_host->render_process_host()->GetHandle(), 404 extension_host->render_process_host()->Shutdown(content::RESULT_CODE_KILLED,
405 content::RESULT_CODE_KILLED, false); 405 false);
406 WaitForExtensionCrash(extension->id()); 406 WaitForExtensionCrash(extension->id());
407 407
408 // Only expect panels to close. The rest stay open to show a sad-tab. 408 // Only expect panels to close. The rest stay open to show a sad-tab.
409 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 2, num_popups, 0)); 409 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 2, num_popups, 0));
410 } 410 }
411 #endif // !defined(OS_CHROMEOS) 411 #endif // !defined(OS_CHROMEOS)
412 412
413 #if defined(USE_ASH_PANELS) 413 #if defined(USE_ASH_PANELS)
414 // This test is not applicable on Ash. The modified window.open behavior only 414 // This test is not applicable on Ash. The modified window.open behavior only
415 // applies to non-Ash panel windows. 415 // applies to non-Ash panel windows.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 last_loaded_extension_id() + "/newtab.html"), 503 last_loaded_extension_id() + "/newtab.html"),
504 false, 504 false,
505 &newtab)); 505 &newtab));
506 506
507 // Extension API should succeed. 507 // Extension API should succeed.
508 bool result = false; 508 bool result = false;
509 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", 509 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()",
510 &result)); 510 &result));
511 EXPECT_TRUE(result); 511 EXPECT_TRUE(result);
512 } 512 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_crash_recovery_browsertest.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698