OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |