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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
37 #include "base/mac/scoped_nsautorelease_pool.h" | 37 #include "base/mac/scoped_nsautorelease_pool.h" |
38 #endif | 38 #endif |
39 | 39 |
40 using base::ASCIIToUTF16; | 40 using base::ASCIIToUTF16; |
41 using extensions::Extension; | 41 using extensions::Extension; |
42 | 42 |
43 class AppBackgroundPageApiTest : public ExtensionApiTest { | 43 class AppBackgroundPageApiTest : public ExtensionApiTest { |
44 public: | 44 public: |
45 void SetUpCommandLine(CommandLine* command_line) override { | 45 void SetUpCommandLine(base::CommandLine* command_line) override { |
46 ExtensionApiTest::SetUpCommandLine(command_line); | 46 ExtensionApiTest::SetUpCommandLine(command_line); |
47 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 47 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
48 command_line->AppendSwitch(extensions::switches::kAllowHTTPBackgroundPage); | 48 command_line->AppendSwitch(extensions::switches::kAllowHTTPBackgroundPage); |
49 } | 49 } |
50 | 50 |
51 bool CreateApp(const std::string& app_manifest, | 51 bool CreateApp(const std::string& app_manifest, |
52 base::FilePath* app_dir) { | 52 base::FilePath* app_dir) { |
53 if (!app_dir_.CreateUniqueTempDir()) { | 53 if (!app_dir_.CreateUniqueTempDir()) { |
54 LOG(ERROR) << "Unable to create a temporary directory."; | 54 LOG(ERROR) << "Unable to create a temporary directory."; |
55 return false; | 55 return false; |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 extensions::ProcessManager::Get(browser()->profile()); | 642 extensions::ProcessManager::Get(browser()->profile()); |
643 ImpulseCallbackCounter idle_impulse_counter(manager, extension()->id()); | 643 ImpulseCallbackCounter idle_impulse_counter(manager, extension()->id()); |
644 EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied()); | 644 EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied()); |
645 | 645 |
646 manager->SetKeepaliveImpulseDecrementCallbackForTesting( | 646 manager->SetKeepaliveImpulseDecrementCallbackForTesting( |
647 idle_impulse_counter.SetGoalAndGetCallback(1)); | 647 idle_impulse_counter.SetGoalAndGetCallback(1)); |
648 nacl_modules_loaded.Reply("be idle"); | 648 nacl_modules_loaded.Reply("be idle"); |
649 idle_impulse_counter.Wait(); | 649 idle_impulse_counter.Wait(); |
650 #endif | 650 #endif |
651 } | 651 } |
OLD | NEW |