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

Unified Diff: chrome/browser/ui/panels/panel_manager.h

Issue 8892020: Make Panel tests faster by reducing time intervals in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_frame_view.cc ('k') | chrome/browser/ui/panels/panel_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_manager.h
diff --git a/chrome/browser/ui/panels/panel_manager.h b/chrome/browser/ui/panels/panel_manager.h
index c36f8c7d592850b5d0e27f5d260e629cd2bd0d74..b744d509fe71f959a67ee31e79d3a19eb5d0fb8c 100644
--- a/chrome/browser/ui/panels/panel_manager.h
+++ b/chrome/browser/ui/panels/panel_manager.h
@@ -88,7 +88,20 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
return panel_overflow_strip_.get();
}
+ // Reduces time interval in tests to shorten test run time.
+ // Wrapper should be used around all time intervals in panels code.
+ static inline double AdjustTimeInterval(double interval) {
+ if (shorten_time_intervals_)
+ return interval / 100.0;
+ else
+ return interval;
+ }
+
#ifdef UNIT_TEST
+ static void shorten_time_intervals_for_testing() {
+ shorten_time_intervals_ = true;
+ }
+
void set_auto_hiding_desktop_bar(
AutoHidingDesktopBar* auto_hiding_desktop_bar) {
auto_hiding_desktop_bar_ = auto_hiding_desktop_bar;
@@ -139,6 +152,9 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
// Tests may want to use a mock panel mouse watcher.
void SetMouseWatcher(PanelMouseWatcher* watcher);
+ // Tests may want to shorten time intervals to reduce running time.
+ static bool shorten_time_intervals_;
+
scoped_ptr<PanelStrip> panel_strip_;
scoped_ptr<PanelOverflowStrip> panel_overflow_strip_;
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_frame_view.cc ('k') | chrome/browser/ui/panels/panel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698