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

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

Issue 547003002: Remove the --event-page-idle-time and --event-page-suspending-time switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 1s Created 6 years, 3 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
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 "chrome/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 6
7 #include "chrome/browser/extensions/lazy_background_page_test_util.h" 7 #include "chrome/browser/extensions/lazy_background_page_test_util.h"
8 #include "chrome/browser/notifications/desktop_notification_profile_util.h" 8 #include "chrome/browser/notifications/desktop_notification_profile_util.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "extensions/browser/process_manager.h" 11 #include "extensions/browser/process_manager.h"
12 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
13 #include "extensions/common/switches.h"
14 13
15 class NotificationIdleTest : public ExtensionApiTest { 14 class NotificationIdleTest : public ExtensionApiTest {
16 protected: 15 protected:
17 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 16 virtual void SetUpOnMainThread() OVERRIDE {
18 ExtensionApiTest::SetUpCommandLine(command_line); 17 ExtensionApiTest::SetUpOnMainThread();
19 18
20 command_line->AppendSwitchASCII( 19 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1);
21 extensions::switches::kEventPageIdleTime, "1000"); 20 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1);
22 command_line->AppendSwitchASCII(
23 extensions::switches::kEventPageSuspendingTime, "1000");
24 } 21 }
25 22
26 const extensions::Extension* LoadExtensionAndWait( 23 const extensions::Extension* LoadExtensionAndWait(
27 const std::string& test_name) { 24 const std::string& test_name) {
28 LazyBackgroundObserver page_complete; 25 LazyBackgroundObserver page_complete;
29 base::FilePath extdir = test_data_dir_.AppendASCII(test_name); 26 base::FilePath extdir = test_data_dir_.AppendASCII(test_name);
30 const extensions::Extension* extension = LoadExtension(extdir); 27 const extensions::Extension* extension = LoadExtension(extdir);
31 if (extension) 28 if (extension)
32 page_complete.Wait(); 29 page_complete.Wait();
33 return extension; 30 return extension;
(...skipping 22 matching lines...) Expand all
56 IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) { 53 IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) {
57 const extensions::Extension* extension = 54 const extensions::Extension* extension =
58 LoadExtensionAndWait("notifications/api/unload"); 55 LoadExtensionAndWait("notifications/api/unload");
59 ASSERT_TRUE(extension) << message_; 56 ASSERT_TRUE(extension) << message_;
60 57
61 // Lazy Background Page has been shut down. 58 // Lazy Background Page has been shut down.
62 extensions::ProcessManager* pm = 59 extensions::ProcessManager* pm =
63 extensions::ExtensionSystem::Get(profile())->process_manager(); 60 extensions::ExtensionSystem::Get(profile())->process_manager();
64 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); 61 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id()));
65 } 62 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/lazy_background_page_apitest.cc ('k') | extensions/browser/process_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698