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

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

Issue 197693003: Replace --ppapi-keep-alive-throttle command line switch with IPC parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move literal to .h to avoid static initializer Created 6 years, 9 months 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 | components/nacl/browser/nacl_process_host.h » ('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) 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"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/extensions/extension_apitest.h" 13 #include "chrome/browser/extensions/extension_apitest.h"
14 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/extensions/extension_test_message_listener.h" 15 #include "chrome/browser/extensions/extension_test_message_listener.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_dialogs.h" 18 #include "chrome/browser/ui/browser_dialogs.h"
19 #include "chrome/browser/ui/browser_window.h" 19 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/extensions/application_launch.h" 20 #include "chrome/browser/ui/extensions/application_launch.h"
21 #include "chrome/common/chrome_paths.h" 21 #include "chrome/common/chrome_paths.h"
22 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
23 #include "components/nacl/browser/nacl_process_host.h"
23 #include "content/public/browser/notification_service.h" 24 #include "content/public/browser/notification_service.h"
24 #include "content/public/test/test_notification_tracker.h" 25 #include "content/public/test/test_notification_tracker.h"
25 #include "content/public/test/test_utils.h" 26 #include "content/public/test/test_utils.h"
26 #include "extensions/common/extension.h" 27 #include "extensions/common/extension.h"
27 #include "extensions/common/switches.h" 28 #include "extensions/common/switches.h"
28 #include "net/dns/mock_host_resolver.h" 29 #include "net/dns/mock_host_resolver.h"
29 #include "net/test/embedded_test_server/embedded_test_server.h" 30 #include "net/test/embedded_test_server/embedded_test_server.h"
30 #include "ppapi/shared_impl/ppapi_switches.h"
31 31
32 #if defined(OS_MACOSX) 32 #if defined(OS_MACOSX)
33 #include "base/mac/scoped_nsautorelease_pool.h" 33 #include "base/mac/scoped_nsautorelease_pool.h"
34 #endif 34 #endif
35 35
36 using base::ASCIIToUTF16; 36 using base::ASCIIToUTF16;
37 using extensions::Extension; 37 using extensions::Extension;
38 38
39 class AppBackgroundPageApiTest : public ExtensionApiTest { 39 class AppBackgroundPageApiTest : public ExtensionApiTest {
40 public: 40 public:
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 : extension_(NULL) { 124 : extension_(NULL) {
125 PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_); 125 PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_);
126 app_dir_ = app_dir_.AppendASCII( 126 app_dir_ = app_dir_.AppendASCII(
127 "ppapi/tests/extensions/background_keepalive/newlib"); 127 "ppapi/tests/extensions/background_keepalive/newlib");
128 } 128 }
129 virtual ~AppBackgroundPageNaClTest() { 129 virtual ~AppBackgroundPageNaClTest() {
130 } 130 }
131 131
132 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 132 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
133 AppBackgroundPageApiTest::SetUpCommandLine(command_line); 133 AppBackgroundPageApiTest::SetUpCommandLine(command_line);
134 command_line->AppendSwitchASCII( 134 nacl::NaClProcessHost::SetPpapiKeepAliveThrottleForTesting(50);
135 switches::kPpapiKeepAliveThrottle, "50");
136 command_line->AppendSwitchASCII( 135 command_line->AppendSwitchASCII(
137 extensions::switches::kEventPageIdleTime, "1000"); 136 extensions::switches::kEventPageIdleTime, "1000");
138 command_line->AppendSwitchASCII( 137 command_line->AppendSwitchASCII(
139 extensions::switches::kEventPageSuspendingTime, "1000"); 138 extensions::switches::kEventPageSuspendingTime, "1000");
140 } 139 }
141 140
142 const Extension* extension() { return extension_; } 141 const Extension* extension() { return extension_; }
143 142
144 protected: 143 protected:
145 void LaunchTestingApp() { 144 void LaunchTestingApp() {
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); 637 extensions::ExtensionSystem::Get(browser()->profile())->process_manager();
639 ImpulseCallbackCounter idle_impulse_counter(manager, extension()->id()); 638 ImpulseCallbackCounter idle_impulse_counter(manager, extension()->id());
640 EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied()); 639 EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied());
641 640
642 manager->SetKeepaliveImpulseDecrementCallbackForTesting( 641 manager->SetKeepaliveImpulseDecrementCallbackForTesting(
643 idle_impulse_counter.SetGoalAndGetCallback(1)); 642 idle_impulse_counter.SetGoalAndGetCallback(1));
644 nacl_modules_loaded.Reply("be idle"); 643 nacl_modules_loaded.Reply("be idle");
645 idle_impulse_counter.Wait(); 644 idle_impulse_counter.Wait();
646 } 645 }
647 646
OLDNEW
« no previous file with comments | « no previous file | components/nacl/browser/nacl_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698