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/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/background/background_contents_service.h" | 8 #include "chrome/browser/background/background_contents_service.h" |
9 #include "chrome/browser/background/background_contents_service_factory.h" | 9 #include "chrome/browser/background/background_contents_service_factory.h" |
10 #include "chrome/browser/background/background_mode_manager.h" | 10 #include "chrome/browser/background/background_mode_manager.h" |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 manager->SetKeepaliveImpulseCallbackForTesting( | 609 manager->SetKeepaliveImpulseCallbackForTesting( |
610 extensions::ProcessManager::ImpulseCallbackForTesting()); | 610 extensions::ProcessManager::ImpulseCallbackForTesting()); |
611 } | 611 } |
612 | 612 |
613 // Verify that nacl modules that go idle will not send keepalive impulses. | 613 // Verify that nacl modules that go idle will not send keepalive impulses. |
614 // Disabled on windows due to Win XP failures: | 614 // Disabled on windows due to Win XP failures: |
615 // DesktopWindowTreeHostWin::HandleCreate not implemented. crbug.com/331954 | 615 // DesktopWindowTreeHostWin::HandleCreate not implemented. crbug.com/331954 |
616 #if defined(OS_WIN) | 616 #if defined(OS_WIN) |
617 #define MAYBE_BackgroundKeepaliveIdle DISABLED_BackgroundKeepaliveIdle | 617 #define MAYBE_BackgroundKeepaliveIdle DISABLED_BackgroundKeepaliveIdle |
618 #else | 618 #else |
619 #define MAYBE_BackgroundKeepaliveIdle BackgroundKeepaliveIdle | 619 // ASAN errors appearing: https://crbug.com/332440 |
| 620 #define MAYBE_BackgroundKeepaliveIdle DISABLED_BackgroundKeepaliveIdle |
620 #endif | 621 #endif |
621 IN_PROC_BROWSER_TEST_F(AppBackgroundPageNaClTest, | 622 IN_PROC_BROWSER_TEST_F(AppBackgroundPageNaClTest, |
622 MAYBE_BackgroundKeepaliveIdle) { | 623 MAYBE_BackgroundKeepaliveIdle) { |
623 ExtensionTestMessageListener nacl_modules_loaded("nacl_modules_loaded", true); | 624 ExtensionTestMessageListener nacl_modules_loaded("nacl_modules_loaded", true); |
624 LaunchTestingApp(); | 625 LaunchTestingApp(); |
625 extensions::ProcessManager* manager = | 626 extensions::ProcessManager* manager = |
626 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); | 627 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); |
627 ImpulseCallbackCounter idle_impulse_counter(extension()->id()); | 628 ImpulseCallbackCounter idle_impulse_counter(extension()->id()); |
628 EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied()); | 629 EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied()); |
629 | 630 |
630 manager->SetKeepaliveImpulseDecrementCallbackForTesting( | 631 manager->SetKeepaliveImpulseDecrementCallbackForTesting( |
631 idle_impulse_counter.SetGoalAndGetCallback(1)); | 632 idle_impulse_counter.SetGoalAndGetCallback(1)); |
632 nacl_modules_loaded.Reply("be idle"); | 633 nacl_modules_loaded.Reply("be idle"); |
633 idle_impulse_counter.Wait(); | 634 idle_impulse_counter.Wait(); |
634 | 635 |
635 // Clear callback to free reference to message loop in ImpulseCallbackCounter. | 636 // Clear callback to free reference to message loop in ImpulseCallbackCounter. |
636 manager->SetKeepaliveImpulseDecrementCallbackForTesting( | 637 manager->SetKeepaliveImpulseDecrementCallbackForTesting( |
637 extensions::ProcessManager::ImpulseCallbackForTesting()); | 638 extensions::ProcessManager::ImpulseCallbackForTesting()); |
638 } | 639 } |
639 | 640 |
OLD | NEW |