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

Unified Diff: ui/views/animation/test/test_ink_drop_hover_observer.h

Issue 1897073002: Add MD Ink Drop Layers to InkDropHost only when a ripple/hover is active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed InkDropHoverTests to use proper expectation comparisons. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/animation/test/test_ink_drop_hover_observer.h
diff --git a/ui/views/animation/test/test_ink_drop_hover_observer.h b/ui/views/animation/test/test_ink_drop_hover_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..c60d84cd82ff47c50bf848d54f905416fa975df7
--- /dev/null
+++ b/ui/views/animation/test/test_ink_drop_hover_observer.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_HOVER_OBSERVER_H_
+#define UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_HOVER_OBSERVER_H_
+
+#include "base/macros.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/views/animation/ink_drop_hover.h"
+#include "ui/views/animation/ink_drop_hover_observer.h"
+#include "ui/views/animation/ink_drop_state.h"
+#include "ui/views/animation/test/test_ink_drop_animation_observer_helper.h"
+
+namespace views {
+namespace test {
+
+// Simple InkDropHoverObserver test double that tracks if InkDropHoverObserver
+// methods are invoked and the parameters used for the last invocation.
+class TestInkDropHoverObserver
+ : public InkDropHoverObserver,
+ public TestInkDropAnimationObserverHelper<InkDropHover::AnimationType> {
+ public:
+ TestInkDropHoverObserver();
+ ~TestInkDropHoverObserver() override = default;
+
+ void set_ink_drop_hover(InkDropHover* ink_drop_hover) {
+ ink_drop_hover_ = ink_drop_hover;
+ }
+
+ // InkDropHoverObserver:
+ void AnimationStarted(InkDropHover::AnimationType animation_type) override;
+ void AnimationEnded(InkDropHover::AnimationType animation_type,
+ InkDropAnimationEndedReason reason) override;
+
+ private:
+ // The type this inherits from. Reduces verbosity in .cc file.
+ using ObserverHelper =
+ TestInkDropAnimationObserverHelper<InkDropHover::AnimationType>;
+
+ // An InkDropHover to spy info from when notifications are handled.
+ InkDropHover* ink_drop_hover_ = nullptr;
+
+ DISALLOW_COPY_AND_ASSIGN(TestInkDropHoverObserver);
+};
+
+} // namespace test
+} // namespace views
+
+#endif // UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_HOVER_OBSERVER_H_
« no previous file with comments | « ui/views/animation/test/test_ink_drop_animation_observer.h ('k') | ui/views/animation/test/test_ink_drop_hover_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698