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

Unified Diff: ash/common/system/tray/tray_details_view_unittest.cc

Issue 2494943005: [ash-md] Added a delay between system menu default/detailed view transitions. (Closed)
Patch Set: Addressed danakj@ comments. Created 4 years, 1 month 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 | « ash/common/system/tray/tray_details_view.cc ('k') | base/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_details_view_unittest.cc
diff --git a/ash/common/system/tray/tray_details_view_unittest.cc b/ash/common/system/tray/tray_details_view_unittest.cc
index 86b6251a0b2b9ce74aa5d43fac94a2274df982dc..de992610ba578976b4db881271d47a327a229498 100644
--- a/ash/common/system/tray/tray_details_view_unittest.cc
+++ b/ash/common/system/tray/tray_details_view_unittest.cc
@@ -9,10 +9,13 @@
#include "ash/common/system/tray/special_popup_row.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_item.h"
+#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_header_button.h"
#include "ash/common/system/tray/view_click_listener.h"
#include "ash/test/ash_test_base.h"
#include "base/run_loop.h"
+#include "base/test/scoped_mock_time_message_loop_task_runner.h"
+#include "base/test/test_mock_time_task_runner.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
#include "ui/events/test/event_generator.h"
@@ -136,6 +139,8 @@ class TrayDetailsViewTest : public AshTestBase {
void TransitionFromDetailedToDefaultView(TestDetailsView* detailed) {
detailed->TransitionToDefaultView();
+ scoped_task_runner_->FastForwardBy(base::TimeDelta::FromMilliseconds(
+ GetTrayConstant(TRAY_POPUP_TRANSITION_TO_DEFAULT_DELAY)));
}
void FocusBackButton(TestDetailsView* detailed) {
@@ -143,6 +148,9 @@ class TrayDetailsViewTest : public AshTestBase {
}
private:
+ // Used to control the |transition_delay_timer_|.
+ base::ScopedMockTimeMessageLoopTaskRunner scoped_task_runner_;
+
DISALLOW_COPY_AND_ASSIGN(TrayDetailsViewTest);
};
« no previous file with comments | « ash/common/system/tray/tray_details_view.cc ('k') | base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698