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

Side by Side Diff: chrome/browser/extensions/api/system_indicator/system_indicator_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/api/system_indicator/system_indicator_manage r.h" 5 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r.h"
6 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r_factory.h" 6 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r_factory.h"
7 #include "chrome/browser/extensions/extension_action.h" 7 #include "chrome/browser/extensions/extension_action.h"
8 #include "chrome/browser/extensions/extension_action_manager.h" 8 #include "chrome/browser/extensions/extension_action_manager.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/lazy_background_page_test_util.h" 10 #include "chrome/browser/extensions/lazy_background_page_test_util.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "extensions/browser/extension_system.h" 12 #include "extensions/browser/extension_system.h"
13 #include "extensions/browser/process_manager.h" 13 #include "extensions/browser/process_manager.h"
14 #include "extensions/common/extension.h" 14 #include "extensions/common/extension.h"
15 #include "extensions/common/switches.h"
16 #include "extensions/test/result_catcher.h" 15 #include "extensions/test/result_catcher.h"
17 16
18 class SystemIndicatorApiTest : public ExtensionApiTest { 17 class SystemIndicatorApiTest : public ExtensionApiTest {
19 public: 18 public:
20 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 19 virtual void SetUpOnMainThread() OVERRIDE {
21 ExtensionApiTest::SetUpCommandLine(command_line); 20 ExtensionApiTest::SetUpOnMainThread();
22 // Set shorter delays to prevent test timeouts in tests that need to wait 21 // Set shorter delays to prevent test timeouts in tests that need to wait
23 // for the event page to unload. 22 // for the event page to unload.
24 command_line->AppendSwitchASCII( 23 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1);
25 extensions::switches::kEventPageIdleTime, "1000"); 24 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1);
26 command_line->AppendSwitchASCII(
27 extensions::switches::kEventPageSuspendingTime, "1000");
28 } 25 }
29 26
30 const extensions::Extension* LoadExtensionAndWait( 27 const extensions::Extension* LoadExtensionAndWait(
31 const std::string& test_name) { 28 const std::string& test_name) {
32 LazyBackgroundObserver page_complete; 29 LazyBackgroundObserver page_complete;
33 base::FilePath extdir = test_data_dir_.AppendASCII(test_name); 30 base::FilePath extdir = test_data_dir_.AppendASCII(test_name);
34 const extensions::Extension* extension = LoadExtension(extdir); 31 const extensions::Extension* extension = LoadExtension(extdir);
35 if (extension) 32 if (extension)
36 page_complete.Wait(); 33 page_complete.Wait();
37 return extension; 34 return extension;
(...skipping 24 matching lines...) Expand all
62 59
63 // Lazy Background Page has been shut down. 60 // Lazy Background Page has been shut down.
64 extensions::ProcessManager* pm = 61 extensions::ProcessManager* pm =
65 extensions::ExtensionSystem::Get(profile())->process_manager(); 62 extensions::ExtensionSystem::Get(profile())->process_manager();
66 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); 63 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id()));
67 64
68 EXPECT_TRUE(manager->SendClickEventToExtensionForTest(extension->id())); 65 EXPECT_TRUE(manager->SendClickEventToExtensionForTest(extension->id()));
69 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 66 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
70 } 67 }
71 } 68 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher_browsertest.cc ('k') | chrome/browser/extensions/app_background_page_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698